Sortable icon indicating copy to clipboard operation
Sortable copied to clipboard

How to let outside state management (Redux, Vuex) handle order and placement?

Open ChristopherJohnson25 opened this issue 2 years ago • 1 comments

How can I use outside state management (Redux, Vuex) handle order and placement? I need to know order and shared item, but how can I let React/Vue manipulate the dom with it's store?

ChristopherJohnson25 avatar Jun 07 '23 22:06 ChristopherJohnson25

I suggest you handle state in Redux and ignore the SortableJS store. Just render the new items to DOM in new order when needed - make sure to not remove the root element (item container) which you passed to Sortable.create(). Update your state after user sorted using appropriate SortableJS events (e.g. onEnd).

mlisowsk avatar Jul 06 '23 19:07 mlisowsk