Skip to content

Commit fc9da2c

Browse files
shaodahongafc163
authored andcommitted
fix: IE browser does not set overflow style
1 parent 41656fe commit fc9da2c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Dialog.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ function offset(el: any) {
5050
interface ICacheOverflow {
5151
overflowX?: string;
5252
overflowY?: string;
53+
overflow?: string;
5354
}
5455
let cacheOverflow: ICacheOverflow = {};
5556

@@ -386,10 +387,16 @@ export default class Dialog extends React.Component<IDialogChildProps, any> {
386387
cacheOverflow = {
387388
overflowX: document.body.style.overflowX,
388389
overflowY: document.body.style.overflowY,
390+
overflow: document.body.style.overflow,
389391
} as ICacheOverflow;
390392
document.body.style.overflow = 'hidden';
391393
switchScrollingEffect();
392394
} else if (!openCount) {
395+
// IE browser doesn't merge overflow style, need to set it separately
396+
// https://github.com/ant-design/ant-design/issues/19393
397+
if (cacheOverflow.overflow !== undefined) {
398+
document.body.style.overflow = cacheOverflow.overflow;
399+
}
393400
if (cacheOverflow.overflowX !== undefined) {
394401
document.body.style.overflowX = cacheOverflow.overflowX;
395402
}

0 commit comments

Comments
 (0)