Skip to content

Commit 454bae5

Browse files
committed
fix of #663
1 parent f45c975 commit 454bae5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/controls/pagination/Pagination.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ export class Pagination extends React.Component<IPaginationProps, IPaginationSta
6060
paginationElements = this.preparePaginationElements(this.props.totalPages);
6161
currentPage = this.state.currentPage > this.props.totalPages ? this.props.totalPages : this.state.currentPage;
6262
}
63-
if (prevProps.totalPages !== this.props.totalPages && this.props.currentPage !== prevProps.currentPage) {
64-
currentPage = this.props.currentPage;
63+
if (this.props.currentPage !== prevProps.currentPage) {
64+
currentPage = this.props.currentPage > this.props.totalPages ? this.props.totalPages : this.props.currentPage;
6565
}
6666

6767
if (!isEqual(this.state.currentPage, currentPage) || !isEqual(this.state.paginationElements, paginationElements)) {
@@ -148,4 +148,4 @@ export class Pagination extends React.Component<IPaginationProps, IPaginationSta
148148
}
149149
}
150150
}
151-
}
151+
}

0 commit comments

Comments
 (0)