Vanessa 2026-02-03 11:42:35 +08:00
parent 23bd4bed95
commit 65ab0c1123
2 changed files with 12 additions and 4 deletions

View file

@ -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;

View file

@ -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