lukasbach / react-complex-tree

Unopinionated Accessible Tree Component with Multi-Select and Drag-And-Drop
https://rct.lukasbach.com
MIT License
915 stars 72 forks source link

Item sort order is not maintained when reparenting multiselections #315

Closed tonyketcham closed 6 months ago

tonyketcham commented 6 months ago

Describe the bug Regression - dragged items (multiple selected) do not maintain their sort order when reparented

To Reproduce Drag a multiple selection of items to a different parent

Expected behavior Should remain same order as initial position

Screenshots

https://github.com/lukasbach/react-complex-tree/assets/43280336/163c2dc4-90a8-4c4c-ad3b-fbb382232d7a

Desktop (please complete the following information):

lukasbach commented 6 months ago

I had another look, and I actually believe the item order was never maintained when dropping items, it always used the order in which items where selected when dropping them 🙃 Anyway, I added some additional logic to sort them again in the displayed order when items are dropped in v2.3.3.