File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/core/onClickOutside Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -84,9 +84,11 @@ export function onClickOutside(
84
84
if ( isIOS && ! _iOSWorkaround ) {
85
85
_iOSWorkaround = true
86
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
87
89
Array . from ( window . document . body . children )
88
- . forEach ( el => useEventListener ( el , 'click' , noop , listenerOptions ) )
89
- useEventListener ( window . document . documentElement , 'click' , noop , listenerOptions )
90
+ . forEach ( el => el . addEventListener ( 'click' , noop , listenerOptions ) )
91
+ window . document . documentElement . addEventListener ( 'click' , noop , listenerOptions )
90
92
}
91
93
92
94
let shouldListen = true
You can’t perform that action at this time.
0 commit comments