Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onIndexChanged returning wrong values #4

Open
UvanShankar opened this issue Aug 31, 2022 · 0 comments
Open

onIndexChanged returning wrong values #4

UvanShankar opened this issue Aug 31, 2022 · 0 comments

Comments

@UvanShankar
Copy link

Which OS ?

Version

Which versions are you using:

  • react-native-swiper v?
  • react-native v0.?.?

Expected behaviour

I want to normally swipe through all of my items I am mapping over

Actual behaviour

Every time I swipe through an item, it send me back to the item I was just on, and when I swipe again, I am then brought to the correct item. This repeats for every new item I see in the UI

When swipe fastly the onIndexChange method is returning values which are far behind the current index value.
This is an open issue in that library as well- leecade#1344

How to reproduce it>

To help us, please fork this component, modify one example in examples folder to reproduce your issue and include link here.

Steps to reproduce

1
Which OS ?
MacOS

Version
Which versions are you using:

"react-native-swiper": "^1.6.0",
"react-native": "0.69.1",

Expected behaviour
I want to normally swipe through all of my items I am mapping over

Actual behaviour
Every time I swipe through an item, it send me back to the item I was just on, and when I swipe again, I am then brought to the correct item. This repeats for every new item I see in the UI

Steps to reproduce
<Swiper
horizontal={true}
showsButtons={false}
index={0}
onIndexChanged={index => setSongIndex(index)}
style={styles.swiper}
showsPagination={false}>
{feed.map(post => {.......

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant