Fix navigation menu's aria-expanded attribute when closed with Escape key
This commit is contained in:
parent
7e8962b491
commit
bbdcd2080b
@ -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…
x
Reference in New Issue
Block a user