react-responsive-carousel
react-responsive-carousel copied to clipboard
[Feature request]: Update swipe behaviour with centerMode
As you know, it's possible to use this library as a slider with multiple slides showing at the same time (with centerMode ON + setting percentages for amount of active slides). It works awesome unless we try to swipe it.
What happening now is you can swipe it for a 10+ slides per time, but the value will change only once so you will 'rolling back' to that slide.
Steps to reproduce the behavior:
- Make a standard slider with 20+ items (slides)
- turn on center mode and for example show 5 items (by setting centerSlidePercentage = 20)
- Try to swipe for a 5-10 items per one event
- You will be moved back into '+1' slide
Expected behavior I see 2 options, which could improve existing behaviour:
- When 'onSwipeEnd' event fired, we could get the index of the central element as the second argument, so we can update 'active' index by ourselves.
- Allow swiping with no updating of the currentItem (so you have to click on item after swipe to make it selected)
TY in advance, ur lib rocks!