FormidableLabs / FormidableLabs/nuka-carousel

scrollDistance=screen can result in cut-off slides

Open
#1,096 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3.1k
Forks
588
PR merge metrics
No merged PRs in 30d

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

### Feature Request

When using `scrollDistance="screen"`, the carousel scrolls by a fixed amount equal to the width of the carousel "viewport". I believe this differs in one key way from previous versions of nuka-carousel with `slidesToScroll="auto"`, in that this scroll distance no longer "stops" to have slides left-aligned. This can lead to some slides always being cut-off.

You can reproduce this on the demo page, a browser viewport width of 600px will illustrate it. In the recording below, slide 2 can never be seen in full (except during animation).

https://github.com/user-attachments/assets/6a4f0c35-2dcd-42e6-b36c-66a742c9a5b6

Would it be reasonable to support a new `scrollDistance` (e.g. `"page"`), that would replicate this older behavior? Such that if a slide is partially cut-off at the end of one page, it becomes the starting slide of the next page (fully visible)?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.