mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-07-03 14:09:06 +02:00
This commit is contained in:
@@ -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", () => {
|
||||
|
||||
@@ -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();
|
||||
|
||||
Vendored
+2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user