From b5acdffc87d894c8f76a96e8c3354a480a0f0c9d Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Mon, 24 Nov 2025 11:06:25 +0800 Subject: [PATCH] fix(annotator): fixed layout shift when selecting text in paginated mode on Android (#2524) --- .../src/app/reader/hooks/useTextSelector.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/readest-app/src/app/reader/hooks/useTextSelector.ts b/apps/readest-app/src/app/reader/hooks/useTextSelector.ts index 065a81f3..c1d184e4 100644 --- a/apps/readest-app/src/app/reader/hooks/useTextSelector.ts +++ b/apps/readest-app/src/app/reader/hooks/useTextSelector.ts @@ -130,15 +130,13 @@ export const useTextSelector = ( isTouchStarted.current = false; }; const handleScroll = () => { - // If a popup (annotation/dictionary/translation) is open, don't dismiss it while scrolling. - if (isPopuped.current) { - return; - } - // Otherwise, behave as before: dismiss selection UI and keep container position if needed. - handleDismissPopup(); + // Prevent the container from scrolling when text is selected in paginated mode + // FIXME: this is a workaround for issue #873 + // TODO: support text selection across pages const viewSettings = getViewSettings(bookKey); if ( appService?.isAndroidApp && + isTextSelected.current && !viewSettings?.scrolled && view?.renderer?.containerPosition && selectionPosition.current