Skip to content

Commit

Permalink
update page index dynamically on page change
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennievon committed Jul 5, 2024
1 parent 3291203 commit 5c092b9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function DataTablePagination<TData>({
variant="outline"
className="h-8 w-8 p-0"
onClick={() => {
setPage(table.getState().pagination.pageIndex);
setPage(table.getState().pagination.pageIndex - 1);
table.previousPage();
}}
disabled={table.getState().pagination.pageIndex === 1}
Expand All @@ -114,7 +114,7 @@ export function DataTablePagination<TData>({
variant="outline"
className="h-8 w-8 p-0"
onClick={() => {
setPage(table.getState().pagination.pageIndex);
setPage(table.getState().pagination.pageIndex + 1);
table.nextPage();
}}
// uncomment the following line when total count feature is implemented
Expand Down

0 comments on commit 5c092b9

Please sign in to comment.