fix(App): close context menu on right-click event

This change ensures that the repository tab context menu is closed
when the user right-clicks anywhere in the window. This improves
the user experience by preventing the context menu from remaining
open unintentionally.

- Added functionality to close the context menu on right-click.
- Updated event handling for context menu to use capture phase.
This commit is contained in:
Christoph Brandau
2026-07-08 15:39:32 +02:00
parent 8793d3de40
commit 44be7afff2
+2 -1
View File
@@ -2801,6 +2801,7 @@
function handleWindowContextMenu(event: MouseEvent) {
event.preventDefault();
if (repoTabContextMenu) closeRepoTabContextMenu();
}
function handleWindowClick() {
@@ -2812,7 +2813,7 @@
<title>GitLite</title>
</svelte:head>
<svelte:window on:click={handleWindowClick} on:keydown={handleWindowKeydown} on:contextmenu={handleWindowContextMenu} />
<svelte:window on:click={handleWindowClick} on:keydown={handleWindowKeydown} on:contextmenu|capture={handleWindowContextMenu} />
<main class="shell">
<TitleBar