Skip to content

Commit 28561d5

Browse files
committed
fix #1169
1 parent 14bcfba commit 28561d5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/BootstrapTable.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -473,17 +473,19 @@ class BootstrapTable extends Component {
473473

474474
handlePaginationData = (page, sizePerPage) => {
475475
const { onPageChange, pageStartIndex } = this.props.options;
476+
const emptyTable = this.store.isEmpty();
476477
if (onPageChange) {
477478
onPageChange(page, sizePerPage);
478479
}
479480

480-
this.setState({
481-
currPage: page,
481+
const state = {
482482
sizePerPage,
483483
reset: false
484-
});
484+
};
485+
if (!emptyTable) state.currPage = page;
486+
this.setState(state);
485487

486-
if (this.allowRemote(Const.REMOTE_PAGE)) {
488+
if (this.allowRemote(Const.REMOTE_PAGE) || emptyTable) {
487489
return;
488490
}
489491

0 commit comments

Comments
 (0)