leecade / react-native-swiper

The best Swiper component for React Native.
MIT License
10.4k stars 2.34k forks source link

Randomly changes page content #1312

Open tapz opened 2 years ago

tapz commented 2 years ago

Which OS ?

Android and iOS

Version

Which versions are you using:

Expected behaviour

Show the correct page and does not automatically change what to show.

Actual behaviour

Shows wrong page even when the dots indicate that another page should be displayed. Automatically changes what page to display even when the user does not swipe the screen. How can it work this randomly?

How to reproduce it

Steps to reproduce

  1. Start the app
lundjrl commented 2 years ago

@tapz I believe I'm running into this issue as well. I have a modal that pops up but when it does, the page gets indexed back once. It only happens when the modal opens.

erthiph commented 2 years ago

im running into this issue too. any ideas? sometimes it gets stuck between two slides too

tapz commented 2 years ago

This is probably because we have scrollviews in the pages and the swiper is implemented using a scrollview. React Native discourages nested scrollviews. I solved the issue by implementing my own swiper, which uses one pages * screen width wide animated view and changes the x offset when swiping. It was pretty simple to implement using react-native-gesture-handler and react-native-reanimated. I probably will make the code available under my github account at some point.

mahadevsempire commented 2 years ago

any solution for this?