How can I fix one element within a dragarea so that sorting will not affect that specific element? In the fiddle (from another user), I want all elements to be draggable and sortable, except for element "C". I want that element to have a fixed position while other elements are free to be dragged/dropped.
Use move props
I'm facing the same issue. The :move handler only prevents an item from being dragged. It does _not_ fix its position.
See here. The goal is for item F to be fixed. While F cannot be dragged, other items can be dragged below F, so its position in the list is not actually fixed.
Fixing an item to the top or bottom of the list is the typical use case.
@EricTetz did you find a solution?
I need to fix an element inside the list, too.
Same issue here. Any updates?
I have made a codepen that solves the issue of locking an item to the top or bottom of the list: https://codepen.io/naffarn/pen/KKdVRRE
This uses the futureIndex property of the evt.draggedContext as well as the index property to test if the object is movable.
Most helpful comment
I'm facing the same issue. The :move handler only prevents an item from being dragged. It does _not_ fix its position.
See here. The goal is for item F to be fixed. While F cannot be dragged, other items can be dragged below F, so its position in the list is not actually fixed.
Fixing an item to the top or bottom of the list is the typical use case.