From 000705dd54ffcd8698ce536cbefb1bf17a85c784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Wed, 24 May 2023 19:21:49 +0800 Subject: [PATCH] chore: adjust to fit ie --- src/hooks/useWinClick.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/hooks/useWinClick.ts b/src/hooks/useWinClick.ts index d6cfd7da..69d289ce 100644 --- a/src/hooks/useWinClick.ts +++ b/src/hooks/useWinClick.ts @@ -57,8 +57,6 @@ export default function useWinClick( const win = getWin(popupEle); - const targetRoot = targetEle?.getRootNode(); - win.addEventListener('mousedown', onWindowMouseDown); win.addEventListener('click', onWindowClick); @@ -71,7 +69,8 @@ export default function useWinClick( // Warning if target and popup not in same root if (process.env.NODE_ENV !== 'production') { - const popupRoot = popupEle.getRootNode(); + const targetRoot = targetEle?.getRootNode?.(); + const popupRoot = popupEle.getRootNode?.(); warning( targetRoot === popupRoot,