meliorence / meliorence/react-native-snap-carousel

firstItem not working on Android

Open
#472 9 comments 4 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?

Android

Is the bug reproductible in a production environment (not a debug one)?

yes

Environment

Environment:
React: 16.0.0-beta.5
React native: 0.51
react-native-snap-carousel: 3.3.4

Target Platform:
Android (6.0)
iOS (11)
-->

(Write your answer here.)

Expected Behavior

scroll to item number specified in firstItem

Actual Behavior

does not scroll

Reproducible Demo
  1. use firstItem on android.

This might be related to https://stackoverflow.com/questions/33208477/react-native-android-scrollview-scrollto-not-working

I fixed it when using scrollTo in my component in a hacky way by introducing a 200ms delay or so on android.

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 6 case with firstItem, then inspect the carousel's firstItem and scrollTo handling, including the reported Android timing behavior. Done means the carousel initially scrolls to the requested item on Android without a caller-side delay, while existing iOS behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.