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

Vanessa65ab0c11238a
diff --git a/app/src/mobile/util/touch.ts b/app/src/mobile/util/touch.ts
index 919181bc34..b68fb19088 100644
--- a/app/src/mobile/util/touch.ts
+++ b/app/src/mobile/util/touch.ts
@@ -27,13 +27,22 @@ 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 (isIPhone() && globalTouchEnd(event, yDiff, time, app)) {
event.stopImmediatePropagation();
event.preventDefault();
return;
}
isFirstMove = true;
- const target = event.target as HTMLElement;
if (!clientY || typeof yDiff === "undefined" ||
target.tagName === "AUDIO" ||
hasClosestByClassName(target, "b3-dialog", true) ||
@@ -67,8 +76,7 @@ export const handleTouchEnd = (event: TouchEvent, app: App) => {
const isXScroll = Math.abs(xDiff) > Math.abs(yDiff);
const modelElement = hasClosestByAttribute(target, "id", "model", true);
if (modelElement) {
- if (isXScroll && firstDirection === "toRight" && !lastClientX &&
- !hasClosestByClassName(target, "protyle-wysiwyg", true)) {
+ if (isXScroll && firstDirection === "toRight" && !lastClientX && !wysisygElement) {
closeModel();
}
return;
diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts
index f7f9045f03..3ea6736751 100644
--- a/app/src/types/index.d.ts
+++ b/app/src/types/index.d.ts
@@ -235,7 +235,6 @@ interface Window {
toCanvas: (element: Element) => Promise<HTMLCanvasElement>
toBlob: (element: Element) => Promise<Blob>
};
-
siyuan: ISiyuan;
JSAndroid: {
returnDesktop(): void
@@ -249,6 +248,7 @@ interface Window {
readHTMLClipboard(): string
getBlockURL(): string
hideKeyboard(): void
+ showKeyboard(): void
print(title: string, html: string): void
getScreenWidthPx(): number
exit(): void