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

Vanessafcb8492fe616
diff --git a/app/src/mobile/util/keyboardToolbar.ts b/app/src/mobile/util/keyboardToolbar.ts
index 7e1d9bb64d..215249025a 100644
--- a/app/src/mobile/util/keyboardToolbar.ts
+++ b/app/src/mobile/util/keyboardToolbar.ts
@@ -654,9 +654,7 @@ export const initKeyboardToolbar = () => {
const oldScrollTop = protyle.contentElement.scrollTop;
renderTextMenu(protyle, toolbarElement);
showKeyboardToolbarUtil(oldScrollTop);
- if (window.JSAndroid && window.JSAndroid.hideKeyboard) {
- window.JSAndroid.hideKeyboard();
- }
+ window.JSAndroid?.hideKeyboard();
}
return;
} else if (type === "moveup") {
@@ -682,9 +680,7 @@ export const initKeyboardToolbar = () => {
const oldScrollTop = protyle.contentElement.scrollTop;
renderSlashMenu(protyle, toolbarElement);
showKeyboardToolbarUtil(oldScrollTop);
- if (window.JSAndroid && window.JSAndroid.hideKeyboard) {
- window.JSAndroid.hideKeyboard();
- }
+ window.JSAndroid?.hideKeyboard();
}
return;
} else if (type === "block") {
diff --git a/app/src/mobile/util/touch.ts b/app/src/mobile/util/touch.ts
index b68fb19088..33690a962f 100644
--- a/app/src/mobile/util/touch.ts
+++ b/app/src/mobile/util/touch.ts
@@ -28,13 +28,14 @@ const popSide = (render = true) => {
export const handleTouchEnd = (event: TouchEvent, app: App) => {
const target = event.target as HTMLElement;
- console.log(event.target);
const wysisygElement = hasClosestByClassName(target, "protyle-wysiwyg", true);
- if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" ||
- (wysisygElement && wysisygElement.getAttribute("data-readonly") === "false")) {
- window.JSAndroid.showKeyboard();
- } else {
- window.JSAndroid.hideKeyboard();
+ if (!yDiff) {
+ if (target.tagName === "INPUT" || target.tagName === "TEXTAREA" ||
+ (wysisygElement && wysisygElement.getAttribute("data-readonly") === "false")) {
+ window.JSAndroid?.showKeyboard();
+ } else {
+ window.JSAndroid?.hideKeyboard();
+ }
}
if (isIPhone() && globalTouchEnd(event, yDiff, time, app)) {