Check aria-expanded value instead of class name to toggle the attribute of navigation toggle button
This commit is contained in:
parent
ee4e82c268
commit
1bc88b6c95
|
@ -96,7 +96,7 @@
|
|||
const showClass = "navbar__links--show";
|
||||
navbarLinks.classList.toggle(showClass);
|
||||
|
||||
if (navbarLinks.classList.contains(showClass)) {
|
||||
if (navbarToggle.getAttribute("aria-expanded") === "false") {
|
||||
navbarToggle.setAttribute("aria-expanded", "true");
|
||||
} else {
|
||||
navbarToggle.setAttribute("aria-expanded", "false");
|
||||
|
|
Loading…
Reference in New Issue