From 3ea6aa8fb347f7930cfa7f157c3a82e0f2bdaf84 Mon Sep 17 00:00:00 2001 From: clawdbot Date: Thu, 29 Jan 2026 07:24:48 +0800 Subject: [PATCH] fix-ignore-editor-hotkeys-in-inputs --- packages/editor/src/editor/hotkeys.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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();