Skip to content

Commit 1d18e59

Browse files
committed
Merge pull request react-bootstrap#946 from firework1230/master
Split commit of PR react-bootstrap#939
2 parents 25a716f + c64679f commit 1d18e59

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Pagination.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ const Pagination = React.createClass({
5151
if(!hasHiddenPagesAfter){
5252
endPage = items;
5353
startPage = items - maxButtons + 1;
54+
if(startPage < 1){
55+
startPage = 1;
56+
}
5457
} else {
5558
endPage = startPage + maxButtons - 1;
5659
}
@@ -109,7 +112,7 @@ const Pagination = React.createClass({
109112
<PaginationButton
110113
key='next'
111114
eventKey={this.props.activePage + 1}
112-
disabled={this.props.activePage === this.props.items}
115+
disabled={this.props.activePage >= this.props.items}
113116
onSelect={this.props.onSelect}>
114117
<span aria-label='Next'>&rsaquo;</span>
115118
</PaginationButton>
@@ -141,7 +144,7 @@ const Pagination = React.createClass({
141144
<PaginationButton
142145
key='last'
143146
eventKey={this.props.items}
144-
disabled={this.props.activePage === this.props.items}
147+
disabled={this.props.activePage >= this.props.items}
145148
onSelect={this.props.onSelect}>
146149
<span aria-label='Last'>&raquo;</span>
147150
</PaginationButton>

0 commit comments

Comments
 (0)