Skip to content

Commit 0083c80

Browse files
authored
chore: adjust to fit ie (#388)
1 parent 6d7caf4 commit 0083c80

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/hooks/useWinClick.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ export default function useWinClick(
5757

5858
const win = getWin(popupEle);
5959

60-
const targetRoot = targetEle?.getRootNode();
61-
6260
win.addEventListener('mousedown', onWindowMouseDown);
6361
win.addEventListener('click', onWindowClick);
6462

@@ -71,7 +69,8 @@ export default function useWinClick(
7169

7270
// Warning if target and popup not in same root
7371
if (process.env.NODE_ENV !== 'production') {
74-
const popupRoot = popupEle.getRootNode();
72+
const targetRoot = targetEle?.getRootNode?.();
73+
const popupRoot = popupEle.getRootNode?.();
7574

7675
warning(
7776
targetRoot === popupRoot,

0 commit comments

Comments
 (0)