meliorence / meliorence/react-native-snap-carousel

[Android] The first item is displayed incorrectly if you set the render from the end

Open
#520 5 comments 8 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?

This is a 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.)

Have you made sure that it wasn't a React Native bug?

I'm sure that it's not a problem with RN.

Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?

The bug specific for Android.

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

I think that the environment is not affected by this bug.

Environment

Environment:
React: 16.8.3
React native: 0.59.8
react-native-snap-carousel: 3.7.5

Target Platform:
Android (5.0)

Expected Behavior

I expect that at any length of the array with data, if I specify that the last element of the array should be rendered first, then the last element will be rendered

Actual Behavior

When I set that the first element should render the last element of the array and the array with data consists of 8 elements, the last element render the penultimate element(that is, 7). If the array with data will increase, the render will not be the penultimate,and the second from the end and then the third and so on.

Reproducible Demo

You can check it on your example from your repository. Just add a few elements to the data array (so that there are at least 8 elements in the array) and set the last element of the array to be rendered as the first element.

https://snack.expo.io/S1mbQwuhN

Steps to Reproduce

1 Just add a few elements to the data array (so that there are at least 8 elements in the array)
2 set the last element of the array to be rendered as the first element.

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 in the repository example or the linked Expo Snack by expanding the data array to at least eight items and configuring the last item to render first. Compare Android's first rendered item with the expected last array element. Done means the last item renders first for arrays of the reported lengths without regressing the carousel behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
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.