meliorence / meliorence/react-native-snap-carousel
snapToNext() and snapToPrev() are not working when using snapToItem()
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.5k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
Is this a bug report, a feature request, or a question?
Bug report
Have you followed the required steps before opening a bug report?
- 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?
Yes
Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?
I'm on the Android 7
Is the bug reproductible in a production environment (not a debug one)?
Yes - I tried the released apk but i got the bug!
Environment
Environment:
React: 16.6.1
React native: 0.57.5
react-native-snap-carousel: ^3.7.5
Target Platform:
Android (7.0)
Expected Behavior
snapToNext() and snapToPrev() should work properly.
Actual Behavior
snapToNext() and snapToPrev() are not working!
Reproducible Demo
I'm using AsyncStorage.setItem() to save the this.carousel.currentIndex in componentWillUnmount() and then i use AsyncStorage.getItem() to get the index and this.carousel.snapToItem(responseIndex) in the componentWillMount().
This is working BUT when i use this.carousel.snapToItem(responseIndex) , the snapToNext() and snapToPrev() are not working!
Steps to Reproduce
react-native init TestingProjectyarn add react-native-snap-carousel- use
AsyncStorageand what i mentioned in the Reproducible Demo
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Android 7 flow described with AsyncStorage.setItem(), AsyncStorage.getItem(), and snapToItem(responseIndex), then inspect the carousel entry points for snapToItem(), snapToNext(), and snapToPrev(). Done means restoring an index with snapToItem() no longer prevents snapToNext() and snapToPrev() from moving the carousel.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100