react-sortablejs icon indicating copy to clipboard operation
react-sortablejs copied to clipboard

[bug] Sort property does not work properly

Open Veragin opened this issue 2 years ago • 2 comments

Describe the bug Changing sort property does not update functionality (sort is applied only onMount)

To Reproduce <ReactSortable list={sort} setList={setList} sort={isSorting} >

Steps to reproduce the behavior:

  1. Create a button that can change state isSorting, and render this ReactSortable next to it
  2. By clicking on the button you are not changing functionality

Expected behavior that it will work

Information After looking into your code you are creating Sortable object after onmount => but not updating i think you should be able to update Sortable object by option(name:String[, value:*]) method

Versions - Look in your package.json for this information: react-sortable = 6.1.4 react = 18

Veragin avatar Dec 15 '22 11:12 Veragin

I created a pull request solving this problem

Veragin avatar Dec 15 '22 12:12 Veragin

And guys you should definitely commit your yarn.lock => now I cant even build it ... i had to upgrade @parcel library

Veragin avatar Dec 15 '22 13:12 Veragin