meliorence / meliorence/react-native-snap-carousel

onSnapToItem wrong Index (RTL mode, Android)

Open
#575 4 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

contribution?
Dominant language
JavaScript
Stars
10.5k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

when using RTL or inverted , what happen is , it invertes the indices as well, so if the data array is [0,1,2,3,4] becomes [4,3,2,1,0] , which is wrong , because despite the fact the carousel showing the layout in LTR or RTL fashion, the index should be the same!

also trying to disable inversion using inverted={false} not working, any suggestions here?

EDIT: only happens 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

Reproduce the issue on Android with RTL and inverted carousel settings, then trace how onSnapToItem derives its index. Verify that callbacks preserve the original data-array ordering and that inverted={false} disables inversion; the issue is done when these cases behave consistently.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.