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

Vanessab14eec5c591d
diff --git a/app/src/mobile/index.ts b/app/src/mobile/index.ts
index 3a1d8f966e..4c63574c71 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, writeText} from "../protyle/util/compatibility";
+import {getLocalStorage, isInIOS, writeText} from "../protyle/util/compatibility";
import {getCurrentEditor, openMobileFileById} from "./editor";
import {getSearch} from "../util/functions";
import {checkPublishServiceClosed} from "../util/processMessage";
@@ -94,6 +94,9 @@ class App {
event.preventDefault();
}
+ if (isInIOS()) {
+ return;
+ }
const wysisygElement = hasClosestByClassName(event.target, "protyle-wysiwyg", true);
let editElement: HTMLElement;
if (["INPUT", "TEXTAREA"].includes(event.target.tagName) && event.target.getAttribute("readonly") !== "readonly") {
@@ -102,7 +105,11 @@ class App {
editElement = hasClosestByAttribute(event.target, "contenteditable", "true") as HTMLElement;
}
if (editElement) {
- window.JSAndroid?.showKeyboard();
+ if (window.JSAndroid && window.JSAndroid.showKeyboard) {
+ window.JSAndroid.showKeyboard();
+ } else if (window.JSHarmony && window.JSHarmony.showKeyboard) {
+ window.JSHarmony.showKeyboard();
+ }
}
});
window.addEventListener("beforeunload", () => {
diff --git a/app/src/mobile/util/keyboardToolbar.ts b/app/src/mobile/util/keyboardToolbar.ts
index 59ba4670bf..a01ad8f959 100644
--- a/app/src/mobile/util/keyboardToolbar.ts
+++ b/app/src/mobile/util/keyboardToolbar.ts
@@ -487,6 +487,8 @@ export const hideKeyboardToolbar = () => {
export const activeBlur = () => {
if (window.JSAndroid && window.JSAndroid.hideKeyboard) {
window.JSAndroid.hideKeyboard();
+ } else if (window.JSHarmony && window.JSHarmony.hideKeyboard) {
+ window.JSHarmony.hideKeyboard();
}
hideKeyboardToolbar();
(document.activeElement as HTMLElement).blur();
diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts
index fc74180a28..c78506fe91 100644
--- a/app/src/types/index.d.ts
+++ b/app/src/types/index.d.ts
@@ -254,6 +254,8 @@ interface Window {
exit(): void
};
JSHarmony: {
+ showKeyboard(): void
+ hideKeyboard(): void
openExternal(url: string): void
exportByDefault(url: string): void
changeStatusBarColor(color: string, mode: number): void