We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 18b761b commit 2a907e3Copy full SHA for 2a907e3
src/components/carousel/index.js
@@ -326,9 +326,12 @@ class Carousel extends Component {
326
const {currentStandingPage, currentPage} = this.state;
327
const index = this.getCalcIndex(currentPage);
328
329
- this.setState({currentStandingPage: index});
330
- if (currentStandingPage !== index) {
331
- _.invoke(this.props, 'onChangePage', index, currentStandingPage);
+ const pagesCount = presenter.getChildrenLength(this.props);
+ if (index < pagesCount) {
+ this.setState({currentStandingPage: index});
332
+ if (currentStandingPage !== index) {
333
+ _.invoke(this.props, 'onChangePage', index, currentStandingPage);
334
+ }
335
}
336
};
337
0 commit comments