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

Vanessa2ffc64a500ab
diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.ts
index 8a59345275..3f2c817cee 100644
--- a/app/src/protyle/util/onGet.ts
+++ b/app/src/protyle/util/onGet.ts
@@ -323,7 +323,8 @@ export const enableProtyle = (protyle: IProtyle) => {
return;
}
protyle.disabled = false;
- if (navigator && navigator.maxTouchPoints > 1 && ["MacIntel", "iPhone"].includes(navigator.platform)) {
+ if (isMobile()) {
+ // Android 端空块输入法弹出会收起 https://ld246.com/article/1689713888289
// iPhone,iPad 端 protyle.wysiwyg.element contenteditable 为 true 时,输入会在块中间插入 span 导致保存失败 https://ld246.com/article/1643473862873/comment/1643813765839#comments
} else {
protyle.wysiwyg.element.setAttribute("contenteditable", "true");
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index 315221b36e..45c0d2ec37 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -87,8 +87,9 @@ export class WYSIWYG {
this.element = document.createElement("div");
this.element.className = "protyle-wysiwyg";
this.element.setAttribute("spellcheck", "false");
- if (navigator && navigator.maxTouchPoints > 1 && navigator.platform === "MacIntel") {
+ if (isMobile()) {
// iPhone,iPad 端输入 contenteditable 为 true 时会在块中间插入 span
+ // Android 端空块输入法弹出会收起 https://ld246.com/article/1689713888289
this.element.setAttribute("contenteditable", "false");
} else {
this.element.setAttribute("contenteditable", "true");