Skip to content

Commit 1c115b2

Browse files
authored
Allow native context menus when the buttons are visible (#110)
1 parent ef92933 commit 1c115b2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

source/App.svelte

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,13 @@
103103
});
104104
105105
// Toggle extra buttons on right click on the name
106+
// After the first click, allow the native context menu
106107
let onContextMenu;
107108
$: onContextMenu = event => {
108-
showExtras = !showExtras;
109-
event.preventDefault();
109+
if (!showExtras) {
110+
showExtras = true;
111+
event.preventDefault();
112+
}
110113
};
111114
112115
function handleBurger() {
@@ -173,7 +176,7 @@
173176
{...extension}
174177
bind:enabled={extension.enabled}
175178
bind:showExtras
176-
on:contextmenu={onContextMenu}
179+
on:contextmenu|once={onContextMenu}
177180
{undoStack}
178181
/>
179182
{/if}

0 commit comments

Comments
 (0)