Skip to content

Commit

Permalink
fix(pagination): when total is 0 and pageSize change, current value i…
Browse files Browse the repository at this point in the history
…s 0 (#2624)
  • Loading branch information
betavs authored Nov 29, 2023
1 parent 7875862 commit e78daa3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const Pagination = forwardRef<HTMLDivElement, PaginationProps>((originalProps, r

// 处理改变 pageSize 的逻辑
const changePageSize = (nextPageSize: number) => {
const nextCurrent = Math.min(current, Math.ceil(total / nextPageSize));
const nextCurrent = Math.min(current, Math.max(1, Math.ceil(total / nextPageSize)));
const pageInfo = {
current: nextCurrent,
previous: current,
Expand Down

0 comments on commit e78daa3

Please sign in to comment.