diff --git a/packages/editor/src/editor/hotkeys.ts b/packages/editor/src/editor/hotkeys.ts index c079572..392e8fe 100644 --- a/packages/editor/src/editor/hotkeys.ts +++ b/packages/editor/src/editor/hotkeys.ts @@ -21,15 +21,16 @@ export function bindEditorHotkeys(getShift: () => boolean, dispatch: (a: EditorA const onKeyDown = (e: KeyboardEvent) => { const ctrl = e.ctrlKey || e.metaKey; + // Do not steal common hotkeys while typing in an input/editor. + // (Including Escape: inputs often use it to revert/blur.) + if (isEditableTarget(e.target)) return; + // Esc: clear selection (and closes context menu via selection parity effect). if (e.key === 'Escape') { dispatch({ type: 'selectSingle', id: undefined }); return; } - // Do not steal common hotkeys while typing in an input/editor. - if (isEditableTarget(e.target)) return; - // Undo/redo if (ctrl && e.key.toLowerCase() === 'z') { e.preventDefault();