Always scroll to start of page on page change
By the time the scroll area got scrolled to the start of the visible pages, the previous/next page wasn't yet shown and thus, the scrollable area wasn't updated yet. Thus, in case the scrollable area grew in width due to the page change, the start never got scrolled into view due to triggering the logic too early.
This commit is contained in:
@@ -54,6 +54,7 @@ import {
|
||||
useReaderHideCursorOnInactivity,
|
||||
useReaderHideOverlayOnUserScroll,
|
||||
useReaderHorizontalModeInvertXYScrolling,
|
||||
useReaderScrollToStartOnPageChange,
|
||||
} from '@/modules/reader/utils/Reader.utils.ts';
|
||||
import { TReaderTapZoneContext } from '@/modules/reader/types/TapZoneLayout.types.ts';
|
||||
import { useReaderTapZoneContext } from '@/modules/reader/contexts/ReaderTapZoneContext.tsx';
|
||||
@@ -223,6 +224,12 @@ const BaseReaderViewer = forwardRef(
|
||||
imageRefs,
|
||||
themeDirection,
|
||||
readingDirection,
|
||||
);
|
||||
useReaderScrollToStartOnPageChange(
|
||||
currentPageIndex,
|
||||
isContinuousReadingModeActive,
|
||||
themeDirection,
|
||||
readingDirection,
|
||||
scrollElementRef,
|
||||
);
|
||||
useReaderHideCursorOnInactivity(scrollElementRef);
|
||||
|
||||
Reference in New Issue
Block a user