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:
+2
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user