Closed joekur closed 7 months ago
I'm not yet super familiar with the source code, but I think this may be the section that was handling this case if v4 of nuka-carousel: https://github.com/FormidableLabs/nuka-carousel/blob/v4.8.4/src/index.js#L712-L721
I have been working on fixes to these issues on a fork. Since I mentioned a few different issues above, specifically I am fixing:
scrollMode='remainder'
aligns the last slide to the right of the container, leaving no extra whitespacecellSpacing
, left-align the first slide to the container based on its content, not where its left-padding endsslideWidth
, such that slidesToShow
is dynamically calculated)Before I start opening PRs, I wanted to check that my expectations of functionality match yours, particularly for the first two issues.
On this one I mentioned in the PR description:
In v4, each scroll action would result in the left-most visible slide being left-aligned with the carousel container. But in v5, when using cellSpacing, this is no longer the case. The offset appears to grow with each page scrolled. Note that the main issue is still present when cellSpacing is not used, so these two issues don't seem strictly related.
I wasn't able to reproduce that in this package's storybook, I'm not sure why it's happening in my sandbox example.
Closing as we have moved several versions past this one and the API no longer exists
Bugs and Questions
Describe Your Environment
Describe the Problem
Previously in v4, when using
slidesToScroll="auto"
, scrolling to the end of the slides would align the last slide with the right edge of the carousel, leaving no extra whitespace:Link to the sandbox
In v5 however, scrolling to the end of the carousel can leave the last slide with whitespace to its right, despite the docs stating that:
Link to the sandbox
Expected behavior:
Scrolling to the end of slides aligns the final slide to the right side of the carousel.
Actual behavior
Scrolling to the end of the slides leaves whitespace to the right of the final slide.
Additional Information
I noticed some other changes, potentially bugs, unrelated to the main issue:
cellSpacing
used to not add left padding to the first slide in v4, but in v5 it does, causing the first slide to not align with the carousel containercellSpacing
, this is no longer the case. The offset appears to grow with each page scrolled. Note that the main issue is still present whencellSpacing
is not used, so these two issues don't seem strictly related.I'm not sure how many of these are related, so for the time being I haven't created separate issues.