FormidableLabs / nuka-carousel

Small, fast, and accessibility-first React carousel library with an easily customizable UI and behavior to fit your brand and site.
https://commerce.nearform.com/open-source/nuka-carousel
Other
3.07k stars 595 forks source link

Improve the stability of swiping #1077

Closed carbonrobot closed 1 month ago

carbonrobot commented 1 month ago

Improve the stability of swiping by using a new minSwipeDistance property and calculating the swipe direction to determine the users intent.

Previously we used an input delay (debounce) on drag to determine when to fire the page action. This had the unintended side effect of causing the carousel to "bounce" as the drag velocity did not always match the debounce duration.

This changeset now uses a swipe distance on drag to determine when to move to the next slide/screen, which is more predictable. This also sets up the code to handle mouse events in the future and possibly a vertical scroll option.

Current

nuka_main

This PR

nuka_branch

changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: 3d98e7ee36e593330b31b1404821d94d8ea7e438

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------------- | ----- | | nuka-carousel | Patch |

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

vercel[bot] commented 1 month ago

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 Oct 8, 2024 5:43pm