Skip to content

Commit

Permalink
🐞 fix(onClickOutside): adjust ignore way
Browse files Browse the repository at this point in the history
even if the target is falsy, we should care about the ignore options

fix #3465
  • Loading branch information
Doctor-wu committed Oct 25, 2023
1 parent bacf402 commit 018e21c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/core/onClickOutside/index.ts
Original file line number Diff line number Diff line change
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 018e21c

Please sign in to comment.