@@ -47,7 +47,11 @@ function offset(el: any) {
4747
4848// https://github.com/ant-design/ant-design/issues/19340
4949// https://github.com/ant-design/ant-design/issues/19332
50- let cacheOverflow = { } ;
50+ interface ICacheOverflow {
51+ overflowX ?: string ;
52+ overflowY ?: string ;
53+ }
54+ let cacheOverflow : ICacheOverflow = { } ;
5155
5256export interface IDialogChildProps extends IDialogPropTypes {
5357 getOpenCount : ( ) => number ;
@@ -75,7 +79,6 @@ export default class Dialog extends React.Component<IDialogChildProps, any> {
7579 private sentinelEnd : HTMLElement ;
7680 private dialogMouseDown : boolean ;
7781 private timeoutId : number ;
78- private cacheOverflow : { overflowX : string | null ; overflowY : string | null } ;
7982
8083 constructor ( props : IDialogChildProps ) {
8184 super ( props ) ;
@@ -383,12 +386,14 @@ export default class Dialog extends React.Component<IDialogChildProps, any> {
383386 cacheOverflow = {
384387 overflowX : document . body . style . overflowX ,
385388 overflowY : document . body . style . overflowY ,
386- } ;
389+ } as ICacheOverflow ;
387390 document . body . style . overflow = 'hidden' ;
388391 switchScrollingEffect ( ) ;
389392 } else if ( ! openCount ) {
390- if ( cacheOverflow . overflowX !== undefined || cacheOverflow . overflowY !== undefined ) {
393+ if ( cacheOverflow . overflowX !== undefined ) {
391394 document . body . style . overflowX = cacheOverflow . overflowX ;
395+ }
396+ if ( cacheOverflow . overflowY !== undefined ) {
392397 document . body . style . overflowY = cacheOverflow . overflowY ;
393398 }
394399 cacheOverflow = { } ;
0 commit comments