From b226dc0712c01278ea6fa92ff8aeea50d8ab7318 Mon Sep 17 00:00:00 2001 From: shaodahong Date: Thu, 24 Oct 2019 22:07:47 +0800 Subject: [PATCH] fix: IE browser does not set overflow style --- src/Dialog.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Dialog.tsx b/src/Dialog.tsx index 3e32d3bc..29db54fc 100644 --- a/src/Dialog.tsx +++ b/src/Dialog.tsx @@ -50,6 +50,7 @@ function offset(el: any) { interface ICacheOverflow { overflowX?: string; overflowY?: string; + overflow?: string; } let cacheOverflow: ICacheOverflow = {}; @@ -386,10 +387,16 @@ export default class Dialog extends React.Component { cacheOverflow = { overflowX: document.body.style.overflowX, overflowY: document.body.style.overflowY, + overflow: document.body.style.overflow, } as ICacheOverflow; document.body.style.overflow = 'hidden'; switchScrollingEffect(); } else if (!openCount) { + // IE browser doesn't merge overflow style, need to set it separately + // https://github.com/ant-design/ant-design/issues/19393 + if (cacheOverflow.overflow !== undefined) { + document.body.style.overflow = cacheOverflow.overflow; + } if (cacheOverflow.overflowX !== undefined) { document.body.style.overflowX = cacheOverflow.overflowX; }