-
-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getCurrentIndex returns wrong value when data count is < 3 #299
Comments
I think it is quite similar but not exactly the same. onSnapToItem returns right index. Calling getCurrentIndex in onProgressChange returns wrong index. |
Hi, I still get wrong indexes in 3.1.5 |
What!?.. Did you clear the cache? Just like
|
And also you need to add |
This helped 👍 Thank you! |
Hey, version 3.5.1, same issue with <= 3 items :/ |
Describe the bug
In my project I have map with markers and carousel with detail of selected marker. Swiping the carousel moves the map to the next (previous) marker. When I use onSnapToItem to set new index it's quite slow because the event is fired after the swipe is fully completed. So I decided to set the current index using getCurrentIndex in onProgressChange. It works great if data count is 3 or more. But when looping carousel with 2 items I get indexes 0, 1, 2, 3, 0, 1, 2, 3... instead of 0, 1, 0, 1, 0, 1...
To Reproduce
Expected behavior
Get right current index.
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: