Skip to content

Commit

Permalink
fix(onClickOutside): adjust shouldListen handling timing (#3503)
Browse files Browse the repository at this point in the history
  • Loading branch information
Doctor-wu committed Nov 9, 2023
1 parent 6040e1c commit 6985152
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/core/onClickOutside/index.ts
Expand Up @@ -90,8 +90,7 @@ export function onClickOutside<T extends OnClickOutsideOptions>(
useEventListener(window, 'click', listener, { passive: true, capture }),
useEventListener(window, 'pointerdown', (e) => {
const el = unrefElement(target)
if (el)
shouldListen = !e.composedPath().includes(el) && !shouldIgnore(e)
shouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el))
}, { passive: true }),
detectIframe && useEventListener(window, 'blur', (event) => {
setTimeout(() => {
Expand Down

0 comments on commit 6985152

Please sign in to comment.