From 4ad522c197d4a389a6187a499e9e54d5d8b3994a Mon Sep 17 00:00:00 2001 From: metonym Date: Wed, 7 Feb 2024 14:37:44 -0800 Subject: [PATCH] fix(context-menu): prevent `on:contextmenu` default behavior only when opening menu (#1911) Fixes #1909 --- src/ContextMenu/ContextMenu.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ContextMenu/ContextMenu.svelte b/src/ContextMenu/ContextMenu.svelte index 1e794f0b34..283d777268 100644 --- a/src/ContextMenu/ContextMenu.svelte +++ b/src/ContextMenu/ContextMenu.svelte @@ -59,6 +59,7 @@ /** @type {(e: MouseEvent) => void} */ function openMenu(e) { + e.preventDefault(); const { height, width } = ref.getBoundingClientRect(); if (open || x === 0) { @@ -138,7 +139,7 @@ { if (target != null) return; if (level > 1) return; if (!ref) return;