mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-10-03 10:13:47 +10:00
fix(web): let Escape reach both the command palette and the editor
This commit is contained in:
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user