Can not get the correct current index
See original GitHub issueIs this a bug report, a feature request, or a question?
Bug report.
Have you followed the required steps before opening a bug report?
(Check the step you’ve followed - replace the space character between the square brackets ([]
) by an x
.)
- I have read the guidelines regarding bug report.
- I have reviewed the documentation in its entirety, including the dedicated documentations 📚.
- I have searched for existing issues and made sure that the problem hasn’t already been reported.
- I am using the latest plugin version.
- I am following the issue template closely in order to produce a useful bug report.
Have you made sure that it wasn’t a React Native bug?
It wasn’t React Native bug
Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?
I reproduce this issue on iOS 12.12
Is the bug reproductible in a production environment (not a debug one)?
Yes
Environment
Environment: React: 16.6.3 React native: 0.57.7 react-native-snap-carousel: 3.7.5
Target Platform: iOS (12.12)
Expected Behavior
Should get the correct current index.
Actual Behavior
Can not get the correct current index when item only leaves one.
Reproducible Demo
https://snack.expo.io/@kwguo/react-native-snap-carousel-currentindex-not-correct Delete any item, and tap “Show current index”, the current index will be wrong.
Steps to Reproduce
- Set loop prop are true.
- Delete item until one is left.
- Get current index from ref, the current index will be wrong.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
Fix Git error: you need to resolve your current index first
How to fix Git error: you need to resolve your current index first · Make sure all your changes are committed. · Abort...
Read more >Fix search issues by rebuilding your Instant Search catalog
Identifies locations to be indexed, and locations to be excluded from indexing. On the File tab, choose Options > Search. Under Sources, click...
Read more >Page Indexing report - Search Console Help - Google Support
See which pages Google can find and index on your site, and learn about any indexing problems encountered. Open Page Indexing report.
Read more >Java, How do I get current index/key in "for each" loop [duplicate]
This is indeed the correct answer semantically, for each loop can iterate through streaming data from a remote database which is being updated ......
Read more >Troubleshoot failed rollover index in Amazon OpenSearch ...
I want to use Index State Management (ISM) to roll over my indices on my Amazon OpenSearch Service cluster. However, my index fails...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@MobDevelop @shana0440 had this issue, setting
enableMomentum={true}
fixed it for me
I use
onBeforeSnapToItem
which is better thenonSnapToItem
in my case