瀏覽代碼

:sparkles: fix https://github.com/siyuan-note/siyuan/issues/6573

Vanessa 2 年之前
父節點
當前提交
303f653c33
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/src/protyle/wysiwyg/keydown.ts

+ 2 - 2
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) {