From 303f653c33ba72f3040cfb33174689b4e98b21ee Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 14 Nov 2022 22:26:46 +0800 Subject: [PATCH] :sparkles: fix https://github.com/siyuan-note/siyuan/issues/6573 --- app/src/protyle/wysiwyg/keydown.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts index c53f6d004..f715c6ef4 100644 --- a/app/src/protyle/wysiwyg/keydown.ts +++ b/app/src/protyle/wysiwyg/keydown.ts @@ -73,10 +73,10 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { hideElements(["util"], protyle); if (event.shiftKey && event.key.indexOf("Arrow") > -1) { // 防止连续选中的时候抖动 https://github.com/siyuan-note/insider/issues/657#issuecomment-851391217 - } else if (!event.repeat) { + } else if (!event.repeat && + event.code !== "") { // 悬浮工具会触发但 code 为空 https://github.com/siyuan-note/siyuan/issues/6573 hideElements(["toolbar"], protyle); } - console.log(event) const range = getEditorRange(protyle.wysiwyg.element); const nodeElement = hasClosestBlock(range.startContainer); if (!nodeElement) {