Fix scroll jump on chapter resume with continuous horizontal mode

This commit is contained in:
schroda
2026-04-13 18:16:12 +02:00
parent 9595076dae
commit 323222d0f2
2 changed files with 4 additions and 1 deletions

View File

@@ -282,10 +282,12 @@ const usePreserveOnInfiniteScrollPreviousChapterInitialRender = (
visibleChapters,
);
const doesPreviousChapterExist = currentChapterIndex > 0;
const isRenderOfPreviousChapter = currentPageIndex === 0;
// only relevant when prepending content to the dom due to the resulting layout shift
const isFirstRenderOfPreviousChapter = !previousNextChapterVisibility.previous && isRenderOfPreviousChapter;
const isFirstRenderOfPreviousChapter =
doesPreviousChapterExist && !previousNextChapterVisibility.previous && isRenderOfPreviousChapter;
if (!isFirstRenderOfPreviousChapter) {
return false;
}