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

fix: rebind listeners on effect to address race condition #1565

Closed

Conversation

chrisvxd
Copy link

This fix rebinds the PointerSensor listeners in the effect callback, as the document may change between effects. The existing implementation yielded a race condition that meant that the listeners would sometimes not fire when rapidly dragging between frames.

Although this fix improves the behaviour, the issue sometimes still occurs and likely requires further investigation.

This fix rebinds the PointerSensor listeners in the effect callback, as the document may change between effects. The existing implementation yielded a race condition that meant that the listeners would sometimes not fire when rapidly dragging between frames.

Although this fix improves the behaviour, the issue sometimes still occurs and likely requires further investigation.
Copy link

changeset-bot bot commented Dec 12, 2024

🦋 Changeset detected

Latest commit: 0e2dd48

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

This PR includes changesets to release 7 packages
Name Type
@dnd-kit/dom Patch
@dnd-kit/react Patch
@dnd-kit/abstract Patch
@dnd-kit/collision Patch
@dnd-kit/geometry Patch
@dnd-kit/helpers Patch
@dnd-kit/state 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

source: Draggable,
options: PointerSensorOptions = {}
): () => void {
const target = source.handle ?? source.element;
Copy link
Owner

Choose a reason for hiding this comment

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

this was previously event.target

@chrisvxd
Copy link
Author

Closing in favour of #1566

@chrisvxd chrisvxd closed this Dec 12, 2024
@chrisvxd chrisvxd deleted the rebind-events-on-doc-change branch December 12, 2024 16:20
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