I have a requirement where the sorting of the list depends on the state which can be toggled using a button. The user should be able to sort only when he is in the editing mode. So I need to disable the sorting of the list. Can anyone help me out on how to add the disabled key to the SortableElement in react-sortable-hoc. I tired to search a working example on google but couldn't find any. Can anyone out there help me out on this one?.
Is there a way to disable sorting in react-sortable--hoc
2.7k views Asked by Rohan Naik At
2
From reading the documentation, seems like
SortableElementsupports a disabled flag, you could set the disabled flag to:Where
SortableItemis a wrapper ofSortableElement.If you notice how
SortableElementis defined, it just takes config where you can just pass the disabled flag. Hopefully this solves your issue.