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

[Feature Request] onIndexChange prop for handling when the user swipes.

Open ghost opened this issue 10 years ago • 3 comments

Just a use case that I ran into that I'm having to do myself that I thought some other people may benefit in, also passing the index into the dot/activeDot method would be nice in-case you wanted to render images for each dot. For example, images with numbers that showed the active slide, or thumbnails at the bottom as if it's a gallery.

ghost avatar Sep 08 '16 15:09 ghost

Unless I'm misunderstanding, I think you can achieve this using onMomentumScrollEnd..

You can store the index of the slider (being passed in through the state onMomentumScrollEnd), in the state of your component. And then each time onMomentumScrollEnd is called, you can compare the new index to your stored index, and update your state / images etc. accordingly.

getnashty avatar Sep 08 '16 17:09 getnashty

See #235

taisyo7333 avatar Sep 08 '16 23:09 taisyo7333

It will be nice if we can catch index when we are scrolling not only when we stop to scroll. If you scroll fast enough onMomentumScrollEnd event will not fire!

tomislavHonig avatar Mar 24 '17 16:03 tomislavHonig