Skip to content

Commit

Permalink
fix(onClickOutside): avoid calling safari workaround on right click (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sibbng committed Jun 16, 2022
1 parent 1ef51e9 commit 1988e9c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/core/onClickOutside/index.ts
Expand Up @@ -66,7 +66,11 @@ export function onClickOutside(
shouldListen.value = !!el && !e.composedPath().includes(el)
}, { passive: true }),
useEventListener(window, 'pointerup', (e) => {
fallback = window.setTimeout(() => listener(e), 50)
if (e.button === 0) {
const path = e.composedPath()
e.composedPath = () => path
fallback = window.setTimeout(() => listener(e), 50)
}
}, { passive: true }),
]

Expand Down

0 comments on commit 1988e9c

Please sign in to comment.