We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d7caf4 commit 0083c80Copy full SHA for 0083c80
src/hooks/useWinClick.ts
@@ -57,8 +57,6 @@ export default function useWinClick(
57
58
const win = getWin(popupEle);
59
60
- const targetRoot = targetEle?.getRootNode();
61
-
62
win.addEventListener('mousedown', onWindowMouseDown);
63
win.addEventListener('click', onWindowClick);
64
@@ -71,7 +69,8 @@ export default function useWinClick(
71
69
72
70
// Warning if target and popup not in same root
73
if (process.env.NODE_ENV !== 'production') {
74
- const popupRoot = popupEle.getRootNode();
+ const targetRoot = targetEle?.getRootNode?.();
+ const popupRoot = popupEle.getRootNode?.();
75
76
warning(
77
targetRoot === popupRoot,
0 commit comments