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/6177

Vanessaf1bb3cf3c79a
diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.ts
index 53c616673d..2cee87145e 100644
--- a/app/src/protyle/util/onGet.ts
+++ b/app/src/protyle/util/onGet.ts
@@ -279,8 +279,11 @@ export const disabledProtyle = (protyle: IProtyle) => {
hideElements(["gutter", "toolbar", "select", "hint", "util"], protyle);
protyle.disabled = true;
if (protyle.title) {
- protyle.title.element.querySelector(".protyle-title__input").setAttribute("contenteditable", "false");
+ const titleElement = protyle.title.element.querySelector(".protyle-title__input") as HTMLElement
+ titleElement.setAttribute("contenteditable", "false");
+ titleElement.style.userSelect = "text";
}
+ protyle.wysiwyg.element.style.userSelect = "text";
protyle.wysiwyg.element.setAttribute("contenteditable", "false");
protyle.wysiwyg.element.querySelectorAll('[contenteditable="true"][spellcheck="false"]').forEach(item => {
item.setAttribute("contenteditable", "false");
@@ -294,9 +297,12 @@ export const enableProtyle = (protyle: IProtyle) => {
// iPhone,iPad 端输入 contenteditable 为 true 时会在块中间插入 span
} else {
if (protyle.title) {
- protyle.title.element.querySelector(".protyle-title__input").setAttribute("contenteditable", "true");
+ const titleElement = protyle.title.element.querySelector(".protyle-title__input") as HTMLElement
+ titleElement.setAttribute("contenteditable", "true");
+ titleElement.style.userSelect = "";
}
protyle.wysiwyg.element.setAttribute("contenteditable", "true");
+ protyle.wysiwyg.element.style.userSelect = "";
}
protyle.wysiwyg.element.querySelectorAll('[contenteditable="false"][spellcheck="false"]').forEach(item => {
if (!hasClosestByClassName(item, "protyle-wysiwyg__embed")) {