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

Fix IOS and Android loop infinite scrolling issue #842

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Chathula
Copy link

@Chathula Chathula commented Jun 4, 2021

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

@khoitruongg
Copy link

Tested on Android, and this PR works like a charm

@mjdelb
Copy link

mjdelb commented Jul 22, 2021

Tested and it works now!

@LeeKyungJoon2
Copy link

LeeKyungJoon2 commented Aug 2, 2021

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

@Chathula
Copy link
Author

Chathula commented Aug 2, 2021

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

@LeeKyungJoon2
Copy link

LeeKyungJoon2 commented Aug 2, 2021

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

@mjdelb
Copy link

mjdelb commented Aug 2, 2021

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

@LeeKyungJoon2
Copy link

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

@Chathula
Copy link
Author

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

Thanks!

@bd-arc
Copy link
Contributor

bd-arc commented Sep 13, 2021

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

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

Successfully merging this pull request may close these issues.

5 participants