diff --git a/boudicca.base/publisher-event-html/src/main/resources/static/js/main.js b/boudicca.base/publisher-event-html/src/main/resources/static/js/main.js index fed7ce1e..29394c22 100644 --- a/boudicca.base/publisher-event-html/src/main/resources/static/js/main.js +++ b/boudicca.base/publisher-event-html/src/main/resources/static/js/main.js @@ -52,6 +52,13 @@ document.addEventListener("DOMContentLoaded", () => { } }) + document.addEventListener("keydown", (event) => { + const drawerIsOpen = drawer.classList.contains("drawer-open") + if (event.key === "Escape" && drawerIsOpen) { + closeDrawer() + } + }) + const openDraw = () => { drawer.classList.add("drawer-open"); document.body.style.overflow = "hidden";