Open jduthon opened 1 week ago
Latest commit: 1b88357722e80b6b1285ede035f3de6321ebb682
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
nuka-carousel-website | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 20, 2024 4:20pm |
Description
During implementation of the carousel, we noticed sometimes a weird behavior where the amount that can be scrolled left does not go all the way to the end of the content.
See example from this before recording
https://github.com/FormidableLabs/nuka-carousel/assets/4168055/b7fc3495-ec21-4c69-a9d4-f9c5213f176b
You can notice there the scroll stops at the Slide 8, but technically there are 10 slides (so the last slide is numbered 9)
This is due to the number of pages being calculated as a rounded value, hence if the leftover width is less than half of the container size, the number of pages will be rounded down to the lower value and it'll be impossible to scroll to the end with the buttons/scroll indicators.
I propose the following fix:
Here is the after result from the same story at the same screen size:
https://github.com/FormidableLabs/nuka-carousel/assets/4168055/85933140-837b-44f3-9e25-d7424c318fd1
Type of Change
How Has This Been Tested?
Checklist
pnpm run lint
)pnpm run test:ci-with-server
/pnpm run test
)pnpm changeset
.