meliorence / meliorence/react-native-snap-carousel

snapToNext() and snapToPrev() are not working when using snapToItem()

Open
#434 4 comments 0 reactions 0 assignees View on GitHub

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?
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
  1. react-native init TestingProject
  2. yarn add react-native-snap-carousel
  3. use AsyncStorage and what i mentioned in the Reproducible Demo

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.