forked from akai/readest
fix(annotator): fixed layout shift when selecting text in paginated mode on Android (#2524)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user