mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-08 00:04:21 +01:00
This commit is contained in:
parent
d60415dd79
commit
b14eec5c59
3 changed files with 13 additions and 2 deletions
|
|
@ -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();
|
||||
|
|
|
|||
2
app/src/types/index.d.ts
vendored
2
app/src/types/index.d.ts
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue