Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Commit

Permalink
bug fix animation timing
Browse files Browse the repository at this point in the history
  • Loading branch information
RyotaSugawara committed Sep 1, 2017
1 parent 80fbcd5 commit c9069b9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,17 +335,20 @@ export default class Carousel extends React.Component<CarouselProps, CarouselSta
}, () => {
setTimeout(() => {
this.setState({
animate: false,
currentIndex: index,
showIndex: null,
swipePosition: 0
}, () => {
this.moving = false;
this.resetAutoSlide();
this.setState({
animate: false,
showIndex: null,
currentIndex: index,
}, () => {
this.moving = false;
this.resetAutoSlide();
});
});
}, this.props.duration);
});
}, 1000 / 60); // wait 1 frame (at 60fps) for animate
}, 1000 / 60 * 2); // wait 2 frame (at 60fps) for animate
});
}

Expand Down

0 comments on commit c9069b9

Please sign in to comment.