From 9baffa45492c6c1e960450358d2f1c60f1896eb2 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 3 Apr 2023 18:30:58 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/7868 --- app/src/util/globalShortcut.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/util/globalShortcut.ts b/app/src/util/globalShortcut.ts index 69f5e245d..9c0dcb98f 100644 --- a/app/src/util/globalShortcut.ts +++ b/app/src/util/globalShortcut.ts @@ -1080,7 +1080,8 @@ const editKeydown = (event: KeyboardEvent) => { return true; } const target = event.target as HTMLElement; - if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || hasClosestByAttribute(target, "contenteditable", null)) { + if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || + hasClosestByAttribute(target, "contenteditable", null)) { return false; } if (matchHotKey(window.siyuan.config.keymap.editor.general.refresh.custom, event)) { @@ -1216,7 +1217,9 @@ const fileTreeKeydown = (event: KeyboardEvent) => { return true; } const target = event.target as HTMLElement; - if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || hasClosestByAttribute(target, "contenteditable", null)) { + if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || + hasClosestByAttribute(target, "contenteditable", null) || + hasClosestByClassName(target, "protyle", true)) { return false; } if (bindMenuKeydown(event)) {