Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the stability of swiping #1077

Merged
merged 3 commits into from
Oct 8, 2024
Merged

Improve the stability of swiping #1077

merged 3 commits into from
Oct 8, 2024

Conversation

carbonrobot
Copy link
Contributor

@carbonrobot carbonrobot commented Oct 8, 2024

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

Copy link

changeset-bot bot commented Oct 8, 2024

🦋 Changeset detected

Latest commit: 3d98e7e

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

Copy link

vercel bot commented Oct 8, 2024

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

Copy link

@colinrobertbrooks colinrobertbrooks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carbonrobot carbonrobot merged commit e960459 into main Oct 8, 2024
4 checks passed
@carbonrobot carbonrobot deleted the feat/stable-swipe branch October 8, 2024 18:00
@github-actions github-actions bot mentioned this pull request Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants