Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/3293

Vanessad6dda080a80c
diff --git a/app/src/util/globalShortcut.ts b/app/src/util/globalShortcut.ts
index e1fe2e8c6e..6d5579f867 100644
--- a/app/src/util/globalShortcut.ts
+++ b/app/src/util/globalShortcut.ts
@@ -875,7 +875,14 @@ ${unicode2Emoji(item.icon || Constants.SIYUAN_IMAGE_FILE, false, "b3-list-item__
dialog.element.querySelector("input").focus();
dialog.element.setAttribute("data-key", window.siyuan.config.keymap.general.recentDocs.custom)
dialog.element.addEventListener("click", (event) => {
- window.dispatchEvent(new KeyboardEvent("keydown", {key: "Enter"}))
+ const liElement = hasClosestByClassName(event.target as HTMLElement, "b3-list-item");
+ if (liElement) {
+ dialog.element.querySelector(".b3-list-item--focus").classList.remove("b3-list-item--focus");
+ liElement.classList.add("b3-list-item--focus");
+ window.dispatchEvent(new KeyboardEvent("keydown", {key: "Enter"}))
+ event.stopPropagation();
+ event.preventDefault();
+ }
});
})
}