Fix preserving scroll position on infinite scroll previous chapter load (#913)
When scrolling to the previous chapter, which has not been preloaded, the scroll position got lost due to the resulting layout shift * Update scroll preserve by tracking cursor * Clean up interface * Observe just the wrappers instead of individual images * Switch to `IntersectionObserver` for tracking active element * Clean up adding of observations Co-authored-by: schroda <50052685+schroda@users.noreply.github.com> --------- Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
This commit is contained in:
@@ -282,14 +282,9 @@ const BaseReaderViewer = forwardRef(
|
||||
useReaderAutoScroll(isOverlayVisible, automaticScrolling);
|
||||
useReaderPreserveScrollPosition(
|
||||
scrollElementRef,
|
||||
currentChapter?.id,
|
||||
currentChapterIndex,
|
||||
currentPageIndex,
|
||||
chaptersToRender,
|
||||
visibleChapters,
|
||||
readingMode,
|
||||
isContinuousReadingModeActive,
|
||||
readingDirection,
|
||||
readerNavBarWidth,
|
||||
setPageToScrollToIndex,
|
||||
pageScaleMode,
|
||||
|
||||
Reference in New Issue
Block a user