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

[FEATURE REQUEST] Let the last item stop to the end of container. #297

Closed
dohooo opened this issue Nov 1, 2022 · 2 comments
Closed

[FEATURE REQUEST] Let the last item stop to the end of container. #297

dohooo opened this issue Nov 1, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@dohooo
Copy link
Owner

dohooo commented Nov 1, 2022

    Hey @dohooo, I've been looking at your [multiple example](https://github.com/dohooo/react-native-reanimated-carousel/blob/main/exampleExpo/src/multiple/index.tsx) again, and I've been hitting an issue which I would call "overscrolling". 

When the carousel is set to "loop", everything works as expected, however when loop is disabled, you can scroll the last element all the way to "position 1" instead of it being the last item in the carousel.

Current Implementation:

Slot 1 Slot 2 Slot 3
LastItem Empty Empty

Ideal Implementation

Slot 1 Slot 2 Slot 3
ThirdLastItem SecondLastItem LastItem

I've attached a minimal reproduction in expo here:
https://snack.expo.dev/@srobbins/reanimated-carousel-overscroll-example

I think this would be made possible by allowing us to set maxPages on the ScrollViewGesture, where maxPages would be totalItems.length - numberOfItemsOnScreen, however there would still be a slight problem of navigating to the last item.

Curious what you think about this!

Edit: I believe this is the same issue as #240.

Originally posted by @IAmNatch in #88 (comment)

@dohooo dohooo self-assigned this Nov 1, 2022
@dohooo dohooo added the enhancement New feature or request label Nov 1, 2022
@IAmNatch
Copy link

IAmNatch commented Nov 1, 2022

I have a PR up here: #295

@dohooo dohooo changed the title [FEATURE REQUEST] Make MaxPage Configurable [FEATURE REQUEST] Let the last item stop to the end of container. Jan 10, 2023
@dohooo
Copy link
Owner Author

dohooo commented Jan 10, 2023

Solved in #335

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants