question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`goToIndex` inconsistent behaviour

See original GitHub issue

Describe the bug Not sure if related to https://github.com/dohooo/react-native-reanimated-carousel/issues/185 but with a similar setup to what’s described in that issue, it seems like goToIndex works nicely going backwards but e.g. calling goToIndex(1) from index 0 goes to index 2 in the array and animates in the wrong direction…you can briefly see this happening in this gif

To Reproduce Steps to reproduce the behavior:

  1. Render a carousel like: <Carousel width={300} height={150} data={[1, 2, 3]} onSnapToItem={(index) => console.log(index)} renderItem={({ item }) => ( <Image style={{ width: 300, height: 150 }} source={{ uri: ‘https://images.unsplash.com/photo-1648737154547-b0dfd281c51e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1740&q=80’, }} /> )} />
  2. Add call carouselRef.current.goToIndex(1) programmatically or with a button and note that it goes to final index with the incorrect animation

Additional context React native web

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
saad9624-tribalScalecommented, May 25, 2022

In my case, I want to use dynamic index everyTime so i cannot use scrollTo function because it takes static count. Is there any alternative to scroll to specific index?? @dohooo

1reaction
dohooocommented, May 14, 2022

Try this code. image

Read more comments on GitHub >

github_iconTop Results From Across the Web

BUG: Inconsistent behavior of index values for `DataFrame ...
I have checked that this issue has not already been reported. I have confirmed this bug exists on the latest version of pandas....
Read more >
The neural computation of inconsistent choice behavior - PMC
Here, we develop a novel index that measures the severity of inconsistency of each choice, enabling us to directly trace its neural correlates....
Read more >
Search for Expectancy-Inconsistent Information Reduces ...
The purpose of the present study was to explore the relationship between the need for cognitive closure, cognitive capacity, and the preference ...
Read more >
Excel match function producing inconsistent results
Just try to go to the cell H9 and type 7 2 Enter . The cells H10 and H11 are then re-calculated and...
Read more >
social value-social behavior inconsistency - JSTOR
matter what the source of social value - social behavior inconsistency, one ... mous index of adjustment level was whether any subject had...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found