From 3bd1248767f0f2f0cf20e412435a61b343f8a843 Mon Sep 17 00:00:00 2001 From: "wuyue.xht" Date: Wed, 24 Jun 2020 17:11:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=BD=93=E5=89=8D=E7=BB=84=E4=BB=B6=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E4=B8=A2=E5=A4=B1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/editor-core/src/hotkey.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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,