diff --git a/packages/editor-core/src/hotkey.ts b/packages/editor-core/src/hotkey.ts index 3bf51b550..50cca63ca 100644 --- a/packages/editor-core/src/hotkey.ts +++ b/packages/editor-core/src/hotkey.ts @@ -328,16 +328,16 @@ function getKeyInfo(combination: string, action?: string): KeyInfo { * convention - prevent default and stop propogation on the event */ function fireCallback(callback: HotkeyCallback, e: KeyboardEvent, combo?: string, sequence?: string): void { - if (callback(e, combo) === false) { - e.preventDefault(); - e.stopPropagation(); - } const editor = globalContext.get(Editor); const designer = editor.get('designer'); const node = designer?.currentSelection?.getNodes()?.[0]; const npm = node?.componentMeta?.npm; const selected = [npm?.package, npm?.componentName].filter((item) => !!item).join('-') || node?.componentMeta?.componentName || ''; + if (callback(e, combo) === false) { + e.preventDefault(); + e.stopPropagation(); + } editor?.emit('hotkey.callback.call', { callback, e,