If I swipe left index changes to 1 (initial index = 0) and condition (index > currentIndex = true) is met, so it should be scrolled to slide with index 0
Actual behaviour
After left swipe condition (index > currentIndex = true) is met, so console logs 'Inside', but swiper.current.scrollTo(currentIndex) doesn't work. It happens because swiper state index value is one unit behind real index value and scrollTo function checks whether is it on the same slide, state says yes and nothing changes.
START!SWIPE!SWIPE!
So instead of immediate scrolling scrollTo function waits untill its state changes, and then it scrolls to slide with 0 index. As I have already mentioned it happens because swiper state index value is one unit behind real index value
How to reproduce it>
To help us, please fork this component, modify one example in examples folder to reproduce your issue and include link here.
Which OS ?
Windows 10 x64
Version
Which versions I am using:
Expected behaviour
When using inside onIndexChanged() it lags behind by 1 slide.
If I swipe left index changes to 1 (initial index = 0) and condition (index > currentIndex = true) is met, so it should be scrolled to slide with index 0
Actual behaviour
After left swipe condition (index > currentIndex = true) is met, so console logs 'Inside', but swiper.current.scrollTo(currentIndex) doesn't work. It happens because swiper state index value is one unit behind real index value and scrollTo function checks whether is it on the same slide, state says yes and nothing changes.
START!
SWIPE!
SWIPE!
![image](https://user-images.githubusercontent.com/67509134/90809273-e6965e80-e329-11ea-92ef-32ab4f9a0014.png)
So instead of immediate scrolling scrollTo function waits untill its state changes, and then it scrolls to slide with 0 index. As I have already mentioned it happens because swiper state index value is one unit behind real index value
How to reproduce it>
To help us, please fork this component, modify one example in examples folder to reproduce your issue and include link here.
Steps to reproduce