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

Fixed an issue with collision detection using stale rects #656

Merged
merged 1 commit into from
Mar 15, 2022

Conversation

clauderic
Copy link
Owner

The rect.current ref stored on DroppableContainers can be stale if measuring is scheduled but has not completed yet. Collision detection algorithms should use the droppableRects map instead to get the latest, most up-to-date measurement of a droppable container in order to avoid computing collisions against stale rects.

@changeset-bot
Copy link

changeset-bot bot commented Mar 15, 2022

🦋 Changeset detected

Latest commit: c1b3b5a

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

The `rect.current` ref stored on DroppableContainers can be stale if measuring is scheduled but has not completed yet. Collision detection algorithms should use the `droppableRects` map instead to get the latest, most up-to-date measurement of a droppable container in order to avoid computing collisions against stale rects.
@clauderic clauderic force-pushed the fix-collision-detection-rects branch from b98754b to c1b3b5a Compare March 15, 2022 02:19
@github-actions
Copy link
Contributor

Size Change: +37 B (0%)

Total Size: 69.7 kB

Filename Size Change
packages/core/dist/core.cjs.development.js 18.6 kB -2 B (0%)
packages/core/dist/core.cjs.production.min.js 11.4 kB +12 B (0%)
packages/core/dist/core.esm.js 18.5 kB -3 B (0%)
packages/sortable/dist/sortable.cjs.development.js 4.22 kB +7 B (0%)
packages/sortable/dist/sortable.cjs.production.min.js 2.8 kB +15 B (+1%)
packages/sortable/dist/sortable.esm.js 4.1 kB +8 B (0%)
ℹ️ View Unchanged
Filename Size
packages/accessibility/dist/accessibility.cjs.development.js 640 B
packages/accessibility/dist/accessibility.cjs.production.min.js 486 B
packages/accessibility/dist/accessibility.esm.js 503 B
packages/accessibility/dist/index.js 148 B
packages/core/dist/index.js 141 B
packages/modifiers/dist/index.js 144 B
packages/modifiers/dist/modifiers.cjs.development.js 829 B
packages/modifiers/dist/modifiers.cjs.production.min.js 625 B
packages/modifiers/dist/modifiers.esm.js 744 B
packages/sortable/dist/index.js 144 B
packages/utilities/dist/index.js 144 B
packages/utilities/dist/utilities.cjs.development.js 2.13 kB
packages/utilities/dist/utilities.cjs.production.min.js 1.29 kB
packages/utilities/dist/utilities.esm.js 2 kB

compressed-size-action

@clauderic clauderic merged commit ce6a517 into master Mar 15, 2022
@clauderic clauderic deleted the fix-collision-detection-rects branch March 15, 2022 02:32
@github-actions github-actions bot mentioned this pull request Mar 15, 2022
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.

None yet

1 participant