Closed juh9870 closed 11 months ago
I think the problem is that I use the items Id to track which item should be animated after the drag finishes, and since the id's change since you use the items index as id this now animates the wrong item. I haven't found a good solution to work around this. I tried using the index instead of the id but couldn't make that work.
I've just released egui_dnd 0.5.1 which adds the option to configure the animation duration for the swap and return animations, so you could now use dnd(..).with_return_animation_time(0.0) to completely disable the return animation.
Thanks, good enough for me!
Awesome! It's not really fixed but I'll still close the issue since I'm not sure if this is possible to be fixed. If someone stumbles over this in the future, feel free to reopen!
When indices (enumerate) is used as ID for a list with duplicate items, there is a weird snapping animation when dropping an item on a different position.
Here is a modified
update_on_drop
example to illustrate the issue.Unlike this example, in my actual app, there is no sane way to pre-index the Vec, like what is done in
sort_words
example. I only get&mut Vec<T>
and I can't ensure that T is unique in any way.