clauderic / dnd-kit

The modern, lightweight, performant, accessible and extensible drag & drop toolkit for React.
http://dndkit.com
MIT License
11.9k stars 602 forks source link

[next] Feature Request: Apply different `activationConstraints` based on `pointerType` #1431

Closed latin-1 closed 2 weeks ago

clauderic commented 2 weeks ago

This should be possible. I have not had the chance to document this yet but you can pass a function to activationConstraints and look at the event and return different activation constraints depending on the input type, example usage:

https://github.com/clauderic/dnd-kit/blob/experimental/packages/dom/src/core/manager/manager.ts#L29