Fix collapsing navbar dropdown when clicking another element #1552
@ -25,7 +25,11 @@ function navSectionsToggle() {
|
|||||||
|
|
||||||
function navSectionsClose(event) {
|
function navSectionsClose(event) {
|
||||||
// Hide all dropdowns when clicking in different place
|
// Hide all dropdowns when clicking in different place
|
||||||
if (event.target.matches(".nav-summary")) return;
|
if (
|
||||||
|
event.target.matches(".nav-summary") ||
|
||||||
|
event.target.parentNode.matches(".nav-summary")
|
||||||
|
)
|
||||||
|
return;
|
||||||
navSections.forEach(navSection => {
|
navSections.forEach(navSection => {
|
||||||
navSection.open = !open;
|
navSection.open = !open;
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user