Skip to content

Commit

Permalink
fix(Pagination): handle case when total lower than page size
Browse files Browse the repository at this point in the history
  • Loading branch information
zouxuoz committed Apr 29, 2019
1 parent 830766b commit 88f75e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Pagination/Pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class Pagination extends React.Component<PaginationProps, PaginationState> {
const { total, onChange } = this.props;
const { page } = this.state;

const nextPage = Math.min(page, Math.round(total / pageSize));
const nextPage = Math.min(page, Math.ceil(total / pageSize));

this.setState(() => ({ pageSize, page: nextPage }));

Expand Down

0 comments on commit 88f75e9

Please sign in to comment.