Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
only preventDefault on root context menu
  • Loading branch information
NyxCode committed May 3, 2021
commit cfc99c53bf106da2e34aee595ad56ca01fc4d483
3 changes: 2 additions & 1 deletion src/ContextMenu/ContextMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@

function onContextMenu(e) {
if (level > 1) return;
e.preventDefault();
open = true;
x = e.x;
y = e.y;
}
</script>

<svelte:window
on:contextmenu|preventDefault="{onContextMenu}"
on:contextmenu="{onContextMenu}"
on:click="{(e) => {
if (!open) return;
if (e.target.contains(ref)) close();
Expand Down