Enable using escape key to close navigation toggle
This commit is contained in:
parent
fb4515acc5
commit
a7c2bf8f29
|
@ -111,4 +111,11 @@
|
|||
}
|
||||
|
||||
navbarToggle.addEventListener("click", toggleNavigation);
|
||||
|
||||
window.addEventListener("keyup", (e) => {
|
||||
if (e.key === "Escape") {
|
||||
navbarToggle.focus();
|
||||
closeNavigation();
|
||||
}
|
||||
});
|
||||
</script>
|
Loading…
Reference in New Issue