diff --git a/app.vue b/app.vue index 9fb1768..391fc96 100644 --- a/app.vue +++ b/app.vue @@ -17,12 +17,21 @@ const contextMenu = useState("contextMenu", () => ({ show: onMounted(() => { loadPreferredThemes() + document.addEventListener("contextmenu", (e) => { + if (contextMenu.value.show) { + e.preventDefault(); + if (e.target instanceof Element && !e.target.classList.contains("context-menu-item")) { + removeContextMenu(contextMenu); + } + } + }); + document.addEventListener("mousedown", (e) => { if (e.target instanceof HTMLElement && e.target.classList.contains("context-menu-item")) return; console.log("click"); console.log("target:", e.target); console.log(e.target instanceof HTMLDivElement); - if (contextMenu.value.show) { + if (e.button != 2 && contextMenu.value.show) { console.log("context menu is shown, hiding"); removeContextMenu(contextMenu); } diff --git a/components/Guild/MemberEntry.vue b/components/Guild/MemberEntry.vue index e7fcbab..4e13c00 100644 --- a/components/Guild/MemberEntry.vue +++ b/components/Guild/MemberEntry.vue @@ -1,30 +1,33 @@