Skip to content
Permalink
Browse files

fix: added 'onSlideEnd' to Carousel (fix: #3405) (#3515)

  • Loading branch information
mxschmitt authored and taion committed Mar 4, 2019
1 parent d9429a9 commit b836c9c07e62b00f7ad4534da6b4a83e9ce72108
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/Carousel.js
@@ -167,7 +167,7 @@ class Carousel extends React.Component {
}

componentDidUpdate(_, prevState) {
const { bsPrefix, slide } = this.props;
const { bsPrefix, slide, onSlideEnd } = this.props;
if (
!slide ||
this.state.activeIndex === prevState.activeIndex ||
@@ -204,12 +204,15 @@ class Carousel extends React.Component {
currentClasses: classNames(orderClassName, directionalClassName),
},
() =>
transition.end(nextElement, () =>
transition.end(nextElement, () => {
this.safeSetState(
{ prevClasses: '', currentClasses: 'active' },
this.handleSlideEnd,
),
),
);
if (onSlideEnd) {
onSlideEnd();
}
}),
);
},
);

0 comments on commit b836c9c

Please sign in to comment.
You can’t perform that action at this time.