From 9ee67313f51026ca93fb76c8933f8f11751a82e5 Mon Sep 17 00:00:00 2001 From: suryacp23 Date: Thu, 16 Jul 2026 17:57:37 +0530 Subject: [PATCH] pagination fixed --- src/components/reusable/Pagination.tsx | 11 ++++++++--- src/components/rv/RecordView.tsx | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/reusable/Pagination.tsx b/src/components/reusable/Pagination.tsx index c7be302..13914f9 100644 --- a/src/components/reusable/Pagination.tsx +++ b/src/components/reusable/Pagination.tsx @@ -18,20 +18,25 @@ export function Pagination({ page, pageSize, total, onPage }: PaginationProps) { const safePage = Math.min(Math.max(page, 1), totalPages); const start = (safePage - 1) * pageSize; + const handlePageChange = (newPage: number) => { + onPage(newPage); + window.scrollTo({ top: 0, behavior: 'smooth' }); + }; + return ( -
+
Showing {start + 1}–{Math.min(start + pageSize, total)} of {total}
- {safePage} / {totalPages} - diff --git a/src/components/rv/RecordView.tsx b/src/components/rv/RecordView.tsx index d4d7f50..2999f97 100644 --- a/src/components/rv/RecordView.tsx +++ b/src/components/rv/RecordView.tsx @@ -54,7 +54,7 @@ export function RecordView({ rvUid, title = 'Records', columns, - pageSize = 50, + pageSize = 20, onRowClick, rowKey, headerActions,