当点击来自 modal 直接忽略

This commit is contained in:
2betop 2020-05-26 09:34:49 +08:00
parent 72254ea1b7
commit 6d58b2ae22
1 changed files with 8 additions and 5 deletions

View File

@ -116,11 +116,14 @@ export class Drawer extends React.Component<DrawerProps, DrawerState> {
(e.button === 1 && window.event !== null) || e.button === 0;
this.isRootClosed = !!(
isLeftButton &&
closeOnOutside &&
target &&
this.modalDom &&
!this.modalDom.contains(target)
(
isLeftButton &&
closeOnOutside &&
target &&
this.modalDom &&
!this.modalDom.contains(target) &&
!target.closest('[role=dialog]')
) // 干脆过滤掉来自弹框里面的点击
);
}