react-native-carousel icon indicating copy to clipboard operation
react-native-carousel copied to clipboard

animate={false} does not work.

Open ibraheemabukhdair opened this issue 10 years ago • 2 comments

animate={false}, does not work. It automatically moves to the next slide on a click, and then when you click again, it transitions to the next slide even faster until it's moving between slides at 80mph.

ibraheemabukhdair avatar Dec 03 '15 20:12 ibraheemabukhdair

The problem seems to be with the _animateNextPage() function. this._setUpTimer() is being called at the end of the function, every time a page animated, leading to exponential increase in frequency.

Either set up a conditional there, or just remove it from _animateNextPage() to get it working-- I'm not 100% sure what intended behavior is here.

yrokhlin avatar Dec 09 '15 00:12 yrokhlin

Ran into this same issue. It's actually just an extra call to _animateNextPage() towards the end of the '_onAnimationEnd'. It calls this._animateNextPage() again once the activePage has been reset, which should trigger an animation to the next page but it looks like it will run everytime, since onAnimationEnd() is triggered whenever onMomentumScrollEnd fires. Looks like there is a PR but hasn't been merged - https://github.com/nick/react-native-carousel/pull/26

alubling avatar Dec 10 '15 03:12 alubling