i get a draggable list like this, i want the item be draggable only when i click the icon in red box;
enter image description here
<Draggable
isDragDisabled={false}
...
>
{(provided) => (
<div ...properity>
...other
<Icon size={30} onMouseDown />
</div>
)}
</Draggable>
see more code in CodeSandBox
https://codesandbox.io/p/sandbox/drag-sort-6v887c?file=%2Fsrc%2FApp.js%3A65%2C58
enter image description here
as the image show, every item is undraggable when initialized, only when user click the icon, then set the activeIndex, so the target item is draggable. That’s what i try to achieve.
but it can’t work dut to the batch update in react, how can i fix it ?
Or it there any other way to fulfill my needs?
user26652857 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.