From d60d3ea3d62f59ffd5cb2a71051291bc60a81534 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 29 Oct 2024 23:27:33 +0800 Subject: [PATCH] :bug: https://github.com/siyuan-note/siyuan/issues/12967 --- app/src/boot/globalEvent/commonHotkey.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/boot/globalEvent/commonHotkey.ts b/app/src/boot/globalEvent/commonHotkey.ts index 1976bdf46fc..964eb1932e8 100644 --- a/app/src/boot/globalEvent/commonHotkey.ts +++ b/app/src/boot/globalEvent/commonHotkey.ts @@ -134,7 +134,8 @@ export const filterHotkey = (event: KeyboardEvent, app: App) => { return true; } const target = event.target as HTMLElement; - if (isNotCtrl(event) && !event.shiftKey && !event.altKey && + // 点击最近的文档列表会 dispatch keydown 的 Enter https://github.com/siyuan-note/siyuan/issues/12967 + if (event.isTrusted && isNotCtrl(event) && !event.shiftKey && !event.altKey && !["INPUT", "TEXTAREA"].includes(target.tagName) && ["0", "1", "2", "3", "4", "j", "k", "l", ";", "s", " ", "p", "enter", "a", "s", "d", "f", "q", "x"].includes(event.key.toLowerCase())) { let cardElement: Element;