Fix IOS and Android loop infinite scrolling issue
Platforms affected
- Cant's scroll infinitely when loop prop is
true
What does this PR do?
- This will fix infinite scroll issue
What testing has been done on this change?
- tested on both IOS and Android devices
Tested on Android, and this PR works like a charm
Tested and it works now!
@mjdelb @Chathula
Infinite scrolling is not working properly on both iOS and Android. I can't scroll from the second time.
For example, if there are four lists, the first scroll works normally up to four, but the second scroll only displays the second scroll.
Could you check it one more time?
@mjdelb @Chathula
Infinite scrolling is not working properly on both iOS and Android. I can't scroll from the second time.
For example, if there are four lists, the first scroll works normally up to four, but the second scroll only displays the second scroll.
Could you check it one more time?
Can you share me your code snippet to reproduce this?
<Carousel
ref={carouselRef}
data={recommendTest}
renderItem={carouselTest}
sliderWidth={Dimensions.get('window').width}
sliderHeight={300}
itemWidth={Dimensions.get('window').width * 0.832}
inactiveSlideOpacity={1}
inactiveSlideScale={1}
firstItem={0}
onSnapToItem={(index) => setCurrentIndex(index)}
useScrollView={true}
autoplay={true}
loop={true}
autoplayDelay={200}
autoplayInterval={2000}
/>
"react": "^16.13.1", "react-native": "^0.63.3", "react-native-snap-carousel": "^3.9.1",
@Chathula It's the part of the carousel code I'm using. Data is an array of 5 in length. When sliding from left to right, infinite scrolling works well, but when sliding from right to left, infinite scrolling does not work.
I checked in both release and debug states.
Please check and let me know.
How did you integrate this PR?
This fix is not published yet, so in order to use it you cloud either fork this repository, merge this branch locally and use it like that, OR use this PR as package directly. But be aware of the changes, the branch might get deleted when it gets merged, just keep an eye on your email because you will get notified
npm install <user>/<repo>#pull/<id>/head
@mjdelb Thank you for your reply. I look forward to the update soon.
@bd-arc and @Exilz can you check on this PR and merge this. Hope this will be useful for all the users.
Thanks!
@Chathula Thanks a lot for the PR!
The one issue I have is that we're no longer maintaining version 3.x of the plugin. We've been using version 4.x (see #678) for more than a year now in all of our apps. We actually discourage developers to use the previous versions since they were relying on too many hacks to circumvent RN ScrollView's limitations.
So I'm basically torn right now: on the one hand I'm sure your PR is useful, on the other hand I'd like version 3 to rest in peace 😅