toggle active on correct element

active should be toggled on span.nav-item. clicking on svg was toggling active its parent - span.nav-link instead.
This commit is contained in:
sapradhan 2023-12-30 15:14:25 +05:45 committed by GitHub
parent be7bb7c34e
commit 25c6301cf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,7 @@
dropdownMenuToggler.forEach((toggler) => {
toggler?.addEventListener("click", (e) => {
e.target.parentElement.classList.toggle("active");
e.target.closest('.nav-item').classList.toggle("active");
});
});