Reset "pageToScrollToIndex" after page selection

In case the current page changed after selecting a page, the previously selected page couldn't be selected again since the "pageToScrollToIndex" was still set to this page
This commit is contained in:
schroda
2024-12-28 01:28:12 +01:00
parent a69447384b
commit c5630ca5ce
5 changed files with 14 additions and 6 deletions

View File

@@ -181,7 +181,7 @@ const BaseReader = ({
});
setCurrentPageIndex(0);
setPageToScrollToIndex(0);
setPageToScrollToIndex(null);
setTotalPages(0);
setPages([createPageData('', 0)]);
setPageUrls([]);
@@ -216,7 +216,7 @@ const BaseReader = ({
} else {
setArePagesFetched(false);
setCurrentPageIndex(0);
setPageToScrollToIndex(0);
setPageToScrollToIndex(null);
setTotalPages(0);
setPages([createPageData('', 0)]);
setPageUrls([]);