fix(annotator): fixed layout shift when selecting text in paginated mode on Android (#2524)

This commit is contained in:
Huang Xin
2025-11-24 11:06:25 +08:00
committed by GitHub
parent 127609160c
commit b5acdffc87
@@ -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