Skip to content

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

:iphone: 输入框判断改进

Vanessac94f39f88fcf
diff --git a/app/src/mobile/index.ts b/app/src/mobile/index.ts
index 5a4a19b45d..3421fc8739 100644
--- a/app/src/mobile/index.ts
+++ b/app/src/mobile/index.ts
@@ -20,7 +20,7 @@ import {bootSync} from "../dialog/processSystem";
import {initMessage, showMessage} from "../dialog/message";
import {goBack} from "./util/MobileBackFoward";
import {activeBlur, hideKeyboardToolbar, showKeyboardToolbar} from "./util/keyboardToolbar";
-import {getLocalStorage, isInAndroid, isInHarmony, writeText} from "../protyle/util/compatibility";
+import {getLocalStorage, writeText} from "../protyle/util/compatibility";
import {getCurrentEditor, openMobileFileById} from "./editor";
import {getSearch} from "../util/functions";
import {checkPublishServiceClosed} from "../util/processMessage";
@@ -101,7 +101,7 @@ class App {
});
}, Constants.TIMEOUT_TRANSITION);
}
- if (isInAndroid() || isInHarmony()) {
+ if (window.JSAndroid && window.JSAndroid.showKeyboard || window.JSHarmony && window.JSHarmony.showKeyboard) {
const wysisygElement = hasClosestByClassName(event.target, "protyle-wysiwyg", true);
let editElement: HTMLElement;
if ((event.target.tagName === "TEXTAREA" ||
@@ -116,7 +116,7 @@ class App {
}
}
});
- if (isInAndroid() || isInHarmony()) {
+ if (window.JSAndroid && window.JSAndroid.showKeyboard || window.JSHarmony && window.JSHarmony.showKeyboard) {
const __siyuan_original_focus = HTMLElement.prototype.focus;
HTMLElement.prototype.focus = function (this: HTMLElement, ...args) {
try {