outl1ne / nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag & drop.
MIT License
284 stars 120 forks source link

Fix "ghost" duplicates when sorting #191

Closed RobertoNegro closed 1 year ago

RobertoNegro commented 1 year ago

Fixes issues #184 and #189 .

The key attribute should identify the row indifferently from its position.

davidldear commented 1 year ago

Would love to get this merged so we can make this better for our users.

dannyklaassen commented 1 year ago

Please add this fix. It is already open for a month now.

Tarpsvo commented 1 year ago

Heya! Thanks a ton for the PR! I added a fallback as well (${resourceName}-items-${resource.id?.value || index}) just in case. Maybe it might be necessary to use a composite instead, but I hope this will suffice. Will do some testing soon.

The new release is tagged 3.4.7.

Thanks again and good luck to you all!