Fixed a bug where clicking Services in the mobile navigation would
immediately close the window.
This commit is contained in:
1 parent
d16d8732c8
commit
287af0ecc2
7 files changed
+8
-6
No files matched your search
@@ -12,6 +12,8 @@ const navLinks = document.querySelectorAll(".main-nav-link");
|
||||
|
||||
navLinks.forEach((link) => {
|
||||
link.addEventListener("click", () => {
|
||||
const isMobile = window.matchMedia("(max-width: 63em)").matches;
|
||||
if (isMobile && link.closest(".nav-item-dropdown")) return;
|
||||
headerEl.classList.remove("nav-open");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user