From 1988e9c4e90fe6d9c9c5633ebd95dd32e6597711 Mon Sep 17 00:00:00 2001 From: sibbng Date: Thu, 16 Jun 2022 07:39:16 -0700 Subject: [PATCH] fix(onClickOutside): avoid calling safari workaround on right click (#1673) --- packages/core/onClickOutside/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/core/onClickOutside/index.ts b/packages/core/onClickOutside/index.ts index 7050c2ec990..dd408bc4608 100644 --- a/packages/core/onClickOutside/index.ts +++ b/packages/core/onClickOutside/index.ts @@ -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 }), ]