Skip to content

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

Closed
@dohooo

Description

@dohooo
    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)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions