mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
fix(context-menu): prevent on:contextmenu
default behavior only when opening menu (#1911)
Fixes #1909
This commit is contained in:
parent
6590457574
commit
4ad522c197
1 changed files with 2 additions and 1 deletions
|
@ -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 @@
|
|||
</script>
|
||||
|
||||
<svelte:window
|
||||
on:contextmenu|preventDefault="{(e) => {
|
||||
on:contextmenu="{(e) => {
|
||||
if (target != null) return;
|
||||
if (level > 1) return;
|
||||
if (!ref) return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue