diff --git a/rocky/assets/js/dropdown.js b/rocky/assets/js/dropdown.js index 15fdd16f29a..adfe831fea4 100644 --- a/rocky/assets/js/dropdown.js +++ b/rocky/assets/js/dropdown.js @@ -38,8 +38,9 @@ document.addEventListener("click", () => { const activeButton = document.querySelector( ".dropdown-button[aria-expanded='true']", ); + const activeDropdown = activeButton?.closest(".dropdown"); - if (activeButton) { + if (activeDropdown && !activeDropdown.contains(e.target)) { const activeList = document.getElementById( activeButton.getAttribute("aria-controls"), );