1+ import * as React from 'react' ;
12import classnames from 'classnames' ;
23import getScrollBarSize from 'rc-util/lib/getScrollBarSize' ;
34import KeyCode from 'rc-util/lib/KeyCode' ;
4- import * as React from 'react ' ;
5+ import omit from 'omit.js ' ;
56
67import { IDrawerChildProps } from './IDrawerPropTypes' ;
78
@@ -284,9 +285,8 @@ class DrawerChild extends React.Component<IDrawerChildProps, IState> {
284285 } ;
285286
286287 private toggleScrollingToDrawerAndBody = ( right : number ) => {
287- const { getOpenCount , getContainer, showMask, open } = this . props ;
288+ const { getContainer, showMask, open } = this . props ;
288289 const container = getContainer && getContainer ( ) ;
289- const openCount = getOpenCount && getOpenCount ( ) ;
290290 // 处理 body 滚动
291291 if ( container && container . parentNode === document . body && showMask ) {
292292 const eventArray = [ 'touchstart' ] ;
@@ -300,9 +300,6 @@ class DrawerChild extends React.Component<IDrawerChildProps, IState> {
300300 if ( right ) {
301301 this . addScrollingEffect ( right ) ;
302302 }
303- if ( openCount === 1 ) {
304- document . body . style . overflow = 'hidden' ;
305- }
306303 document . body . style . touchAction = 'none' ;
307304 // 手机禁滚
308305 domArray . forEach ( ( item , i ) => {
@@ -317,10 +314,6 @@ class DrawerChild extends React.Component<IDrawerChildProps, IState> {
317314 ) ;
318315 } ) ;
319316 } else if ( this . getCurrentDrawerSome ( ) ) {
320- // 没有弹框的状态下清除 overflow;
321- if ( ! openCount ) {
322- document . body . style . overflow = '' ;
323- }
324317 document . body . style . touchAction = '' ;
325318 if ( right ) {
326319 this . remScrollingEffect ( right ) ;
@@ -524,7 +517,7 @@ class DrawerChild extends React.Component<IDrawerChildProps, IState> {
524517 } ) ;
525518 return (
526519 < div
527- { ...props }
520+ { ...omit ( props , [ 'switchScrollingEffect' ] ) }
528521 tabIndex = { - 1 }
529522 className = { wrapperClassName }
530523 style = { style }
0 commit comments