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

pointermove and pointerup events should be added to the document only after pointerdown #126

Open
santiagopuentep opened this issue Mar 21, 2023 · 0 comments

Comments

@santiagopuentep
Copy link

santiagopuentep commented Mar 21, 2023

Right now the pointerup and pointermove events are added to the document and constantly active for every draggable object in screen. The pointerup and pointerup should be added only inside the pointerdown event, otherwise this is a big performance issue.

Even better, they can be added to the node directly and node.setPointerCapture(event.pointerId); can be called inside pointerup so that the browser points all events to the node. This has the added benefit that if the pointer ever goes outside the bounds of the draggable, the pointer won't trigger other element's hover events for example.

See this link for more info.

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

No branches or pull requests

1 participant