From b63170c5f100686f08bd4832f26f53dc736a79f7 Mon Sep 17 00:00:00 2001 From: Amruth Pillai Date: Thu, 1 Oct 2026 23:00:51 +0200 Subject: [PATCH] fix(web): let Escape reach both the command palette and the editor --- apps/web/src/features/command-palette/index.tsx | 4 +++- .../builder/$resumeId/-components/use-editor-hotkeys.ts | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/web/src/features/command-palette/index.tsx b/apps/web/src/features/command-palette/index.tsx index 098b52c11..2c13104d9 100644 --- a/apps/web/src/features/command-palette/index.tsx +++ b/apps/web/src/features/command-palette/index.tsx @@ -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); }, }, diff --git a/apps/web/src/routes/builder/$resumeId/-components/use-editor-hotkeys.ts b/apps/web/src/routes/builder/$resumeId/-components/use-editor-hotkeys.ts index 4deb34d01..0be8c9d9f 100644 --- a/apps/web/src/routes/builder/$resumeId/-components/use-editor-hotkeys.ts +++ b/apps/web/src/routes/builder/$resumeId/-components/use-editor-hotkeys.ts @@ -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", () => {