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

Support for tolerance in DistanceConstraint #399

Merged

Conversation

supersebh
Copy link
Contributor

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Aug 4, 2021

🦋 Changeset detected

Latest commit: d812ec3

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

This PR includes changesets to release 3 packages
Name Type
@dnd-kit/core Minor
@dnd-kit/modifiers Major
@dnd-kit/sortable Major

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
Owner

@clauderic clauderic left a comment

Choose a reason for hiding this comment

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

This looks great! Would you mind adding stories and integration tests for minimum distance y and tolerance x?

I'm also a bit unclear as to how this should work if you provided a tolerance that was smaller than the distance or a tolerance that was in a different axis than the distance 🤔

@supersebh
Copy link
Contributor Author

supersebh commented Aug 10, 2021

@clauderic Thank you for the reply!

This looks great! Would you mind adding stories and integration tests for minimum distance y and tolerance x?

Done!

I'm also a bit unclear as to how this should work if you provided a tolerance that was smaller than the distance or a tolerance that was in a different axis than the distance 🤔

The way it's working right now is as soon as you exceed tolerance the drag operation will be aborted, unless it has already started (because distance criteria was met). So you need to be careful and not pick conflicting settings for distance and tolerance if used together. E.g.

{
  distance: {x: 10},
  tolerance: {x: 5},
}

won't make sense since you can never meet the distance criteria without meeting the tolerance criteria first.

Tolerance in different axis than the distance is exactly how we're using it right now in our project, and that is described here.

Please let me know if anything is unclear!

@clauderic
Copy link
Owner

Sounds good 👍 Could you add a changeset to your PR or give me access to your fork so I can do it for you?

@clauderic clauderic merged commit a32a4c5 into clauderic:master Aug 23, 2021
@clauderic clauderic deleted the feature/distance-constraint-tolerance branch August 23, 2021 15:19
@github-actions github-actions bot mentioned this pull request Aug 23, 2021
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