Open iluretar opened 3 years ago
@iluretar Off the top of my head I do not recall a way to do this, but others may have experimented more recently than me. For now I am marking this issue as an enhancement request.
One thing that just occurred to me was that perhaps making the dragged item have draggable={false}
might do it... but I don't think it would. I suspect that is only checked when the drag begins.
In my case, I needed to prevent dragging of only certain items in DraxList, and the method I used is as below code
<DraxList ... itemsDraggable={draggable} onItemDragStart={(e) => { e.item.type === 'title' && setDraggable(false); }} onItemDragEnd={(e) => { e.item.type === 'title' && setDraggable(true); }} ... />
Is it possible to programatically cancel the dragging, for example if the payload meet some criteria?