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

How to get pointer coordinate in CollisionDetector #82

Open
AlanHilal opened this issue Feb 22, 2023 · 1 comment
Open

How to get pointer coordinate in CollisionDetector #82

AlanHilal opened this issue Feb 22, 2023 · 1 comment

Comments

@AlanHilal
Copy link

I am trying to add a custom CollisionDetector that register collision when the pointer is contained within droppable container.
similar to: https://docs.dndkit.com/api-documentation/context-provider/collision-detection-algorithms#pointer-within
I am stuck with finding a way to get coordinates inside CollisionDetector function. is there a way or a workaround to get pointer coordinates inside CollisionDetector?

@martinpengellyphillips
Copy link
Contributor

martinpengellyphillips commented Feb 23, 2023

Probably no good way to get this right now. We could update the collision detector interface to also accept the active sensor in the passed context - that way you can use that to check if it is a pointer sensor and the coordinates to use.

I wonder if we should do that, or expose all of the drag drop state as the context argument instead. Any thoughts there?

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

2 participants