Fix page changes via click/hotkey in horizontal pager

Due to the way the pages got scrolled into view, the current page was not changed to the new page.
This then prevented the previous/next page to get opened via click/hotkey actions
This commit is contained in:
schroda
2024-12-09 15:07:52 +01:00
parent f654d95804
commit 1387a016c7
3 changed files with 41 additions and 5 deletions

View File

@@ -302,7 +302,7 @@ export class ReaderControls {
return;
}
const hasPageIndexChanged = pageIndex !== currentPageIndex;
const hasPageIndexChanged = endReached || pageIndex !== currentPageIndex;
if (!hasPageIndexChanged) {
return;
}
@@ -353,7 +353,7 @@ export class ReaderControls {
// handle cases where the last page is too small to ever be the "firstVisibleImageIndex"
if (isEndReached) {
updateCurrentPageIndex(lastPageIndex, false);
updateCurrentPageIndex(firstVisibleImageIndex, false, true);
return;
}