Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/9235

Vanessa96a618f4a3d3
diff --git a/app/src/boot/globalEvent/keydown.ts b/app/src/boot/globalEvent/keydown.ts
index 65f0266e2d..3769748e95 100644
--- a/app/src/boot/globalEvent/keydown.ts
+++ b/app/src/boot/globalEvent/keydown.ts
@@ -283,9 +283,7 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
return true;
}
const target = event.target as HTMLElement;
- if (target.tagName !== "TABLE" && (
- target.tagName === "INPUT" || target.tagName === "TEXTAREA" || hasClosestByAttribute(target, "contenteditable", null)
- )) {
+ if (target.tagName !== "TABLE" && (target.tagName === "INPUT" || target.tagName === "TEXTAREA")) {
return false;
}
if (matchHotKey(window.siyuan.config.keymap.editor.general.refresh.custom, event)) {
@@ -316,6 +314,9 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
event.preventDefault();
return true;
}
+ if (hasClosestByClassName(target, "protyle-title__input")) {
+ return false;
+ }
// 没有光标时,无法撤销 https://ld246.com/article/1624021111567
if (matchHotKey(window.siyuan.config.keymap.editor.general.undo.custom, event)) {
protyle.undo.undo(protyle);
diff --git a/app/src/protyle/util/reload.ts b/app/src/protyle/util/reload.ts
index 1f7ff8635b..173dbde5b6 100644
--- a/app/src/protyle/util/reload.ts
+++ b/app/src/protyle/util/reload.ts
@@ -6,6 +6,10 @@ import {hasClosestByClassName} from "./hasClosest";
import {preventScroll} from "../scroll/preventScroll";
export const reloadProtyle = (protyle: IProtyle, focus: boolean) => {
+ if (!protyle.preview.element.classList.contains("fn__none")) {
+ protyle.preview.render(protyle);
+ return;
+ }
if (window.siyuan.config.editor.displayBookmarkIcon) {
protyle.wysiwyg.element.classList.add("protyle-wysiwyg--attr");
} else {