diff --git a/gdn-app/src/App.vue b/gdn-app/src/App.vue index 7b1e56e..37903e1 100644 --- a/gdn-app/src/App.vue +++ b/gdn-app/src/App.vue @@ -2,8 +2,18 @@ import CNavbar from "./components/CNavbar.vue"; import CNote from "./components/CNote.vue"; import { useUiStore } from "./stores/ui"; +import { pathAncestor } from "./util"; const ui = useUiStore(); + +window.addEventListener("keypress", (ev) => { + if (document.activeElement !== document.body) return; + + if (ev.key === "Escape") { + ui.focusPath = pathAncestor(ui.focusPath); + return; + } +});