Skip to content

Commit 749002a

Browse files
committed
2 parents 15ee264 + 6fe1812 commit 749002a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/BootstrapTable.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,8 @@ class BootstrapTable extends React.Component {
119119
if (Array.isArray(nextProps.data)) {
120120
this.store.setData(nextProps.data);
121121
let paginationDom = this.refs.pagination;
122-
let page = nextProps.options.page ||
123-
(paginationDom ? paginationDom.getCurrentPage() : 1);
124-
let sizePerPage = nextProps.options.sizePerPage ||
125-
(paginationDom ? paginationDom.getSizePerPage() : Const.SIZE_PER_PAGE_LIST[0]);
122+
let page = paginationDom && paginationDom.getCurrentPage() || nextProps.options.page || 1;
123+
let sizePerPage = paginationDom && paginationDom.getSizePerPage() || nextProps.options.sizePerPage || Const.SIZE_PER_PAGE_LIST[0];
126124
// #125
127125
if(page > Math.ceil(nextProps.data.length / sizePerPage)) page = 1;
128126
let sortInfo = this.store.getSortInfo();

0 commit comments

Comments
 (0)