diff --git a/src/App.vue b/src/App.vue index 3f3f9a83ad..ce1c49e93d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -377,9 +377,18 @@ async function reconnectRestoredTabs() { } } +function handleContextMenu(e: MouseEvent) { + if (!(e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement)) { + e.preventDefault(); + } +} + onMounted(async () => { applyTheme(); window.addEventListener("keydown", handleKeydown, true); + if (isDesktop) { + document.addEventListener("contextmenu", handleContextMenu); + } if (!isDesktop) { try { const res = await fetch("/api/auth/check"); @@ -416,6 +425,7 @@ onMounted(async () => { onUnmounted(() => { window.removeEventListener("keydown", handleKeydown, true); + document.removeEventListener("contextmenu", handleContextMenu); }); diff --git a/src/components/layout/AppSidebar.vue b/src/components/layout/AppSidebar.vue index 2f5aa1f5cf..30d21171b6 100644 --- a/src/components/layout/AppSidebar.vue +++ b/src/components/layout/AppSidebar.vue @@ -1,9 +1,10 @@