From 7221cc1cf23334ac38cc99d511dfc8c9bb04f2e8 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 6 May 2026 19:20:54 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/17628 --- app/src/mobile/util/touch.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/mobile/util/touch.ts b/app/src/mobile/util/touch.ts index d7f9e76b3..2862ff5de 100644 --- a/app/src/mobile/util/touch.ts +++ b/app/src/mobile/util/touch.ts @@ -34,7 +34,8 @@ const popSide = (render = true) => { export const handleTouchEnd = (event: TouchEvent) => { const target = event.target as HTMLElement; - if (isIPhone() && typeof yDiff === "undefined" && new Date().getTime() - time > 900) { + if (!window.siyuan.touchDragActive && isIPhone() && typeof yDiff === "undefined" && + new Date().getTime() - time > 900) { target.dispatchEvent(new MouseEvent("contextmenu", { bubbles: true, cancelable: true, @@ -163,15 +164,17 @@ export const handleTouchEnd = (event: TouchEvent) => { }; export const handleTouchStart = (event: TouchEvent) => { - if (0 < event.touches.length && ((event.touches[0].target as HTMLElement).tagName === "VIDEO" || - (event.touches[0].target as HTMLElement).tagName === "AUDIO")) { + const target = event.touches[0].target as HTMLElement; + if (0 < event.touches.length && (target.tagName === "VIDEO" || target.tagName === "AUDIO")) { // https://github.com/siyuan-note/siyuan/issues/14569 activeBlur(); return; } // 存在其他拖拽元素时 - const otherTouchElement = hasClosestByClassName(event.touches[0].target as Element, "b3-chip"); - if (otherTouchElement && otherTouchElement.parentElement.classList.contains("b3-chips__doctag")) { + const otherTouchElement = hasClosestByClassName(target, "b3-chip"); + if ((otherTouchElement && otherTouchElement.parentElement.classList.contains("b3-chips__doctag")) || + hasClosestByClassName(target, "protyle-gutters") || + (target.tagName === "IMG" && target.style.cursor === "move" && target.parentElement.classList.contains("protyle-background__img"))) { return; } if (getSelection().rangeCount > 0 && hasClosestBlock(event.target as Element)) {