fix(web): let Escape reach both the command palette and the editor

This commit is contained in:
Amruth Pillai
2026-10-01 23:00:51 +02:00
parent 87b5d695a4
commit b63170c5f1
2 changed files with 5 additions and 2 deletions
@@ -36,8 +36,10 @@ export function CommandPalette() {
},
{
hotkey: "Escape",
// The editor also binds Escape. `allow` keeps both; `enabled` so a closed palette does not
// preventDefault every Escape on the page.
options: { enabled: open, conflictBehavior: "allow" },
callback: () => {
if (!open) return;
setOpen(false);
},
},
@@ -58,7 +58,8 @@ export function useEditorHotkeys(setMode: (mode: EditorMode) => void) {
if (isEditableElementFocused() && document.activeElement instanceof HTMLElement) document.activeElement.blur();
useEditorStore.getState().select(null);
},
{ preventDefault: false, stopPropagation: false },
// Command palette binds Escape too. Both handlers should run.
{ preventDefault: false, stopPropagation: false, conflictBehavior: "allow" },
);
useHotkey("Mod+S", () => {