@@ -164,15 +164,16 @@ class DrawerChild extends React.Component<IDrawerChildProps, IState> {
164
164
const differX = e . changedTouches [ 0 ] . clientX - this . startPos . x ;
165
165
const differY = e . changedTouches [ 0 ] . clientY - this . startPos . y ;
166
166
if (
167
- currentTarget === this . maskDom ||
168
- currentTarget === this . handlerDom ||
169
- ( currentTarget === this . contentDom &&
170
- getTouchParentScroll (
171
- currentTarget ,
172
- e . target as HTMLElement ,
173
- differX ,
174
- differY ,
175
- ) )
167
+ ( currentTarget === this . maskDom ||
168
+ currentTarget === this . handlerDom ||
169
+ ( currentTarget === this . contentDom &&
170
+ getTouchParentScroll (
171
+ currentTarget ,
172
+ e . target as HTMLElement ,
173
+ differX ,
174
+ differY ,
175
+ ) ) ) &&
176
+ e . cancelable
176
177
) {
177
178
e . preventDefault ( ) ;
178
179
}
@@ -237,7 +238,7 @@ class DrawerChild extends React.Component<IDrawerChildProps, IState> {
237
238
) => {
238
239
const { placement, levelMove, duration, ease, showMask } = this . props ;
239
240
// router 切换时可能会导至页面失去滚动条,所以需要时时获取。
240
- this . levelDom . forEach ( dom => {
241
+ this . levelDom . forEach ( ( dom ) => {
241
242
dom . style . transition = `transform ${ duration } ${ ease } ` ;
242
243
addEventListener ( dom , transitionEnd , this . transitionEnd ) ;
243
244
let levelValue = open ? value : 0 ;
@@ -435,7 +436,7 @@ class DrawerChild extends React.Component<IDrawerChildProps, IState> {
435
436
} ;
436
437
437
438
private getCurrentDrawerSome = ( ) =>
438
- ! Object . keys ( currentDrawer ) . some ( key => currentDrawer [ key ] ) ;
439
+ ! Object . keys ( currentDrawer ) . some ( ( key ) => currentDrawer [ key ] ) ;
439
440
440
441
private getLevelDom = ( { level, getContainer } : IDrawerChildProps ) => {
441
442
if ( windowIsUndefined ) {
@@ -459,8 +460,8 @@ class DrawerChild extends React.Component<IDrawerChildProps, IState> {
459
460
}
460
461
} ) ;
461
462
} else if ( level ) {
462
- dataToArray ( level ) . forEach ( key => {
463
- document . querySelectorAll ( key ) . forEach ( item => {
463
+ dataToArray ( level ) . forEach ( ( key ) => {
464
+ document . querySelectorAll ( key ) . forEach ( ( item ) => {
464
465
this . levelDom . push ( item ) ;
465
466
} ) ;
466
467
} ) ;
@@ -555,7 +556,7 @@ class DrawerChild extends React.Component<IDrawerChildProps, IState> {
555
556
className = { `${ prefixCls } -mask` }
556
557
onClick = { maskClosable ? onClose : undefined }
557
558
style = { maskStyle }
558
- ref = { c => {
559
+ ref = { ( c ) => {
559
560
this . maskDom = c as HTMLElement ;
560
561
} }
561
562
/>
@@ -568,13 +569,13 @@ class DrawerChild extends React.Component<IDrawerChildProps, IState> {
568
569
width : isNumeric ( width ) ? `${ width } px` : width ,
569
570
height : isNumeric ( height ) ? `${ height } px` : height ,
570
571
} }
571
- ref = { c => {
572
+ ref = { ( c ) => {
572
573
this . contentWrapper = c as HTMLElement ;
573
574
} }
574
575
>
575
576
< div
576
577
className = { `${ prefixCls } -content` }
577
- ref = { c => {
578
+ ref = { ( c ) => {
578
579
this . contentDom = c as HTMLElement ;
579
580
} }
580
581
onTouchStart = {
0 commit comments