-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
Question: Respond to a click on the dragable item #591
Comments
@ofirgellerSM You can find a solution to your problem here: #477 |
@ofirgellerSM The API allows constraining the activation via a delay or distance. Something like that: // All of these are imported from '@dnd-kit/core'.
const sensors = useSensors(
useSensor(PointerSensor, {
activationConstraint: {
distance: 8,
},
})
)
<DndContext sensors={sensors}>
// […]
</DndContext> |
this works perfectly with touch and drag |
@awgv's answer worked for me. But I encountered another problem. When I try to drag an element, the click functionality gets triggered and opens the popover component while also dragging the element. How can I avoid the click once a component is dragged? |
If the user clicks on the item and does not hold the mouse key I would like to run some function.
Normally I would add an "onClick" handler to the element, but it seems like the listeners are colliding with that method.
The text was updated successfully, but these errors were encountered: