Skip to content

Commit 5a533cf

Browse files
committed
fix #1232
1 parent cc79edc commit 5a533cf

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/BootstrapTable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1505,7 +1505,7 @@ BootstrapTable.defaultProps = {
15051505
nextPageTitle: Const.NEXT_PAGE_TITLE,
15061506
firstPageTitle: Const.FIRST_PAGE_TITLE,
15071507
lastPageTitle: Const.LAST_PAGE_TITLE,
1508-
pageStartIndex: undefined,
1508+
pageStartIndex: 1,
15091509
searchDelayTime: undefined,
15101510
exportCSVText: Const.EXPORT_CSV_TEXT,
15111511
insertText: Const.INSERT_BTN_TEXT,

src/util.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,10 @@ export default {
4949
// We calculate an offset here in order to properly fetch the indexed data,
5050
// despite the page start index not always being 1
5151
getNormalizedPage(pageStartIndex, page) {
52+
pageStartIndex = this.getFirstPage(pageStartIndex);
5253
if (page === undefined) page = pageStartIndex;
53-
let normalizedPage;
54-
if (pageStartIndex !== undefined) {
55-
const offset = Math.abs(Const.PAGE_START_INDEX - pageStartIndex);
56-
normalizedPage = page + offset;
57-
} else {
58-
normalizedPage = page;
59-
}
60-
return normalizedPage;
54+
const offset = Math.abs(Const.PAGE_START_INDEX - pageStartIndex);
55+
return page + offset;
6156
},
6257

6358
getFirstPage(pageStartIndex) {

0 commit comments

Comments
 (0)