From 6d58b2ae22fe3d20977b12d2956140707319f0c4 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Tue, 26 May 2020 09:34:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E7=82=B9=E5=87=BB=E6=9D=A5=E8=87=AA?= =?UTF-8?q?=20modal=20=E7=9B=B4=E6=8E=A5=E5=BF=BD=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Drawer.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/Drawer.tsx b/src/components/Drawer.tsx index d2e7434a..7814246b 100644 --- a/src/components/Drawer.tsx +++ b/src/components/Drawer.tsx @@ -116,11 +116,14 @@ export class Drawer extends React.Component { (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]') + ) // 干脆过滤掉来自弹框里面的点击 ); }