Skip to content

Commit

Permalink
Update rocky/assets/js/dropdown.js
Browse files Browse the repository at this point in the history
Co-authored-by: Peter-Paul van Gemerden <[email protected]>
  • Loading branch information
Rieven and ppvg authored Oct 28, 2024
1 parent b2b2d66 commit e961801
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rocky/assets/js/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
);
Expand Down

0 comments on commit e961801

Please sign in to comment.