From 40567de9fd07acef79e3fd8e86bcbfbaf2928e9b Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 3 Jun 2025 16:06:33 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/14789 --- app/src/mobile/util/keyboardToolbar.ts | 10 ---------- app/src/mobile/util/touch.ts | 9 --------- 2 files changed, 19 deletions(-) diff --git a/app/src/mobile/util/keyboardToolbar.ts b/app/src/mobile/util/keyboardToolbar.ts index 26b97672a..5424d0d10 100644 --- a/app/src/mobile/util/keyboardToolbar.ts +++ b/app/src/mobile/util/keyboardToolbar.ts @@ -473,16 +473,6 @@ export const activeBlur = () => { export const initKeyboardToolbar = () => { let preventRender = false; document.addEventListener("selectionchange", () => { - if (isInAndroid()) { - const range = document.getSelection().getRangeAt(0); - const editor = getCurrentEditor(); - if (range.toString() && editor.protyle.wysiwyg.element.contains(range.startContainer) && - range.getBoundingClientRect().top < editor.protyle.contentElement.getBoundingClientRect().top) { - window.siyuan.mobile.androidLastRange = range.cloneRange(); - } else { - window.siyuan.mobile.androidLastRange = null; - } - } if (!preventRender) { renderKeyboardToolbar(); } diff --git a/app/src/mobile/util/touch.ts b/app/src/mobile/util/touch.ts index 92b658525..fe5c81f20 100644 --- a/app/src/mobile/util/touch.ts +++ b/app/src/mobile/util/touch.ts @@ -29,15 +29,6 @@ const popSide = (render = true) => { }; export const handleTouchEnd = (event: TouchEvent, app: App) => { - if (isInAndroid() && window.siyuan.mobile.androidLastRange && getSelection().rangeCount>0) { - const range = getSelection().getRangeAt(0); - if (range.toString() && range.startContainer === window.siyuan.mobile.androidLastRange.startContainer) { - range.setStart(window.siyuan.mobile.androidLastRange.startContainer, window.siyuan.mobile.androidLastRange.startOffset); - focusByRange(range); - const editor = getCurrentEditor(); - editor.protyle.toolbar.range = range; - } - } if (isIPhone() && globalTouchEnd(event, yDiff, time, app)) { event.stopImmediatePropagation(); event.preventDefault();