Skip to content

Commit 2259bf5

Browse files
fix(pagination): updating lastPage variable correctly for table layout (#1151)
fix(pagination): updating lastPage variable to currPage+4 when layout is table for firstpage var fix The page number was not showing correctly on firsrt few clicks because lastPage variable was not updating on first few clicks when layout is table due to incorrect addition. Was working correctly when layout is pagination. fix #1150
1 parent 73993e9 commit 2259bf5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/Pagination/Pagination.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const PaginationComponent: FC<PaginationProps> = ({
6565
}) => {
6666
const theme = mergeDeep(getTheme().pagination, customTheme);
6767

68-
const lastPage = Math.min(Math.max(currentPage + 2, 5), totalPages);
68+
const lastPage = Math.min(Math.max(layout === 'pagination' ? currentPage + 2 : currentPage + 4, 5), totalPages);
6969
const firstPage = Math.max(1, lastPage - 4);
7070

7171
const goToNextPage = (): void => {

0 commit comments

Comments
 (0)