Fix navigation menu's aria-expanded attribute when closed with Escape key
This commit is contained in:
parent
6bbb230f1f
commit
1614230583
|
@ -145,6 +145,7 @@ https://kalechips.net/projects/snippets/burger #}
|
|||
const key = event.code;
|
||||
if (key == "Escape") {
|
||||
navbarBurger.removeAttribute("open");
|
||||
navbarBurger.ariaExpanded = false;
|
||||
document.querySelector(".navbar__toggle").focus();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue