react-native-snap-carousel icon indicating copy to clipboard operation
react-native-snap-carousel copied to clipboard

Fix IOS and Android loop infinite scrolling issue

Open Chathula opened this issue 5 years ago • 9 comments

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

Chathula avatar Jun 04 '21 11:06 Chathula

Tested on Android, and this PR works like a charm

khoitruongg avatar Jul 21 '21 18:07 khoitruongg

Tested and it works now!

mjdelb avatar Jul 22 '21 09:07 mjdelb

@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?

LeeKyungJoon2 avatar Aug 02 '21 08:08 LeeKyungJoon2

@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?

Chathula avatar Aug 02 '21 08:08 Chathula

<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.

LeeKyungJoon2 avatar Aug 02 '21 08:08 LeeKyungJoon2

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 avatar Aug 02 '21 09:08 mjdelb

@mjdelb Thank you for your reply. I look forward to the update soon.

LeeKyungJoon2 avatar Aug 05 '21 04:08 LeeKyungJoon2

@bd-arc and @Exilz can you check on this PR and merge this. Hope this will be useful for all the users.

Thanks!

Chathula avatar Aug 31 '21 09:08 Chathula

@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 😅

bd-arc avatar Sep 13 '21 07:09 bd-arc