diff --git a/src/components/Tables/tenders/useTenderListPresenter.ts b/src/components/Tables/tenders/useTenderListPresenter.ts index 0c30849..82d5ecb 100644 --- a/src/components/Tables/tenders/useTenderListPresenter.ts +++ b/src/components/Tables/tenders/useTenderListPresenter.ts @@ -384,7 +384,7 @@ const useTenderListPresenter = () => { const { pagination, - handlePaginationChange, + handlePaginationChange: changePaginationPage, buildFirstPageParams, hasNext, hasPrevious, @@ -396,6 +396,22 @@ const useTenderListPresenter = () => { error, }); + const handlePaginationChange = useCallback( + (event: { selected: number }) => { + if (typeof window !== "undefined") { + const reduceMotion = window.matchMedia( + "(prefers-reduced-motion: reduce)", + ).matches; + window.scrollTo({ + top: 0, + behavior: reduceMotion ? "auto" : "smooth", + }); + } + changePaginationPage(event); + }, + [changePaginationPage], + ); + const shouldShowPagination = !isPending && (hasPrevious || hasNext); const tendersList = data?.data?.tenders ?? [];