forked from p96170835/amis
优化判断逻辑
This commit is contained in:
parent
e1659bb033
commit
e7ffe5659f
|
@ -115,15 +115,15 @@ export class Drawer extends React.Component<DrawerProps, DrawerState> {
|
||||||
const isLeftButton =
|
const isLeftButton =
|
||||||
(e.button === 1 && window.event !== null) || e.button === 0;
|
(e.button === 1 && window.event !== null) || e.button === 0;
|
||||||
|
|
||||||
this.isRootClosed =
|
this.isRootClosed = !!(
|
||||||
!!(
|
isLeftButton &&
|
||||||
isLeftButton &&
|
closeOnOutside &&
|
||||||
closeOnOutside &&
|
target &&
|
||||||
target &&
|
this.modalDom &&
|
||||||
this.modalDom &&
|
((!this.modalDom.contains(target) && !target.closest('[role=dialog]')) ||
|
||||||
!this.modalDom.contains(target) &&
|
(target.matches(`.${ns}Drawer-overlay`) &&
|
||||||
!target.closest('[role=dialog]')
|
target.parentElement === this.modalDom))
|
||||||
) || target.matches(`.${ns}Drawer-overlay.in`); // 干脆过滤掉来自弹框里面的点击
|
); // 干脆过滤掉来自弹框里面的点击
|
||||||
}
|
}
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
|
|
Loading…
Reference in New Issue