We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a16bfb0 commit 1c60c68Copy full SHA for 1c60c68
packages/core/onClickOutside/index.ts
@@ -84,9 +84,11 @@ export function onClickOutside(
84
if (isIOS && !_iOSWorkaround) {
85
_iOSWorkaround = true
86
const listenerOptions = { passive: true }
87
+ // Not using useEventListener because this event handlers must not be disposed.
88
+ // See previusly linked references and https://github.com/vueuse/vueuse/issues/4724
89
Array.from(window.document.body.children)
- .forEach(el => useEventListener(el, 'click', noop, listenerOptions))
- useEventListener(window.document.documentElement, 'click', noop, listenerOptions)
90
+ .forEach(el => el.addEventListener('click', noop, listenerOptions))
91
+ window.document.documentElement.addEventListener('click', noop, listenerOptions)
92
}
93
94
let shouldListen = true
0 commit comments