Open eladonline opened 3 years ago
@eladonline Im not sure what is causing the issue, but it seems like you are using React. You should try this with react-sortablejs and see if it fixes the problem.
Facing the same issue. Any workarounds found for this?
I'm also working in React, and using the react-sortablejs library.
I have described my use case in this issue
Use dataIdAttr: 'data-id' . Specify 'data-id' in html.
let el = document.querySelector('#id')
let sortable = new Sortable(el, {
dataIdAttr: "data-id",
...
html:
<div id="el">
<div data-id="value1"></div>
<div data-id="value2"></div>
</div>
Describe the bug
To Reproduce Steps to reproduce the behavior: this is the configuration:
this is the Item:
<StyleClassifierContainer data-id={classifier.uid} key={classifier.uid}/>
this is how it saved in the storage:
82b4eae9-1683-4a8b-8317-3abd761054e8|27623740-fae4-429c-9ae9-375cdaac1114
Expected behavior to be sorted as saved in the local storage after refreshing the page
Real behavior ignores the local storage order (only when saved as strings, numbers works as expected)
Information this is how I parse:
Versions: sortablejs = ^1.12.0 @types/sortablejs = not installed