We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug I have a carousel with 3 items - on load if i swipe right 4 times onSnapToItem logs
onSnapToItem
1 2 3 1
from here if i swipe left onSnapToItem logs
0 2 1 0
so it seems the direction you swipe in affects the behaviour of onSnapToItem which seems like a bug..
To Reproduce Steps to reproduce the behavior:
<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', }} /> )} />
Additional context Using react native on the web
The text was updated successfully, but these errors were encountered:
workaround is to use index % data.length as the actual index within onSnapToItem
index % data.length
Sorry, something went wrong.
goToIndex
So you're saying it's only on the Web? https://user-images.githubusercontent.com/32405058/168412467-bbd4d719-ec0c-4401-b6f8-42c86b167adf.mov
57a18ad
dohooo
Successfully merging a pull request may close this issue.
Describe the bug
I have a carousel with 3 items - on load if i swipe right 4 times
onSnapToItem
logsfrom here if i swipe left
onSnapToItem
logsso it seems the direction you swipe in affects the behaviour of
onSnapToItem
which seems like a bug..To Reproduce
Steps to reproduce the behavior:
Additional context
Using react native on the web
The text was updated successfully, but these errors were encountered: