From f1de42f897f14918a0bcebbc37feafb759d39ce1 Mon Sep 17 00:00:00 2001 From: Nirmal Kumar R Date: Sun, 31 May 2026 00:43:28 +0530 Subject: [PATCH] fix: update click handler to prevent menu closure when clicking inside the menu-bar --- src/index.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index 09ec8d4..f25afc4 100644 --- a/src/index.html +++ b/src/index.html @@ -1196,7 +1196,13 @@ }); document.addEventListener("click", (e) => { - if (e.target.closest("#menu-bar")) closeAll(); + // If the click is inside the menu-bar, do not close all + if (e.target.closest("#menu-bar")) return; + + // If any menu-item or dropdown is open, close all + if (document.querySelectorAll('.menu-item.active, .dropdown.open').length > 0) { + closeAll(); + } }); // -- Global Keyboard Shortcuts