-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support css transition of transform to final position #28
Comments
I would love to see something like this. |
Sorry, I might have got the wrong end of the stick on this issue. I am hoping for animations of the "middle" (transitioning) state when two elements swap places while one is being dragged. I'm less concerned by the "final" transition tbh. In sortablejs, this is evident in the simple list example but it also happens in the example you linked. |
Ah, gotcha. So you can use css transform transitions today for the swapping effect. The issue you'll see then is that on drop the dropped item will transition oddly, which is what this issue is about. |
Gosh, I didn't even think of looking at how you were rearranging things under the hood. I just assumed you were changing the DOM, not adjusting styling. Makes sense. Thanks. |
Update on this - I'm exploring two approaches currently: A) Defer clearing drag state until after all B) Treat animation as an entirely separate concern. This approach attempts to do something similar to autoAnimate - it observes the dnd state and runs animations as appropriate. This is likely to be cleanest solution, but I'm still working through some complexity around changing nodes. |
After extensive investigation, I'm going to pursue option (b) and have started foundations for that in 0.7.0. Option (a) ended up overcomplicating the code and expectations for consumers too much. |
Hi. Any updates on this topic? Could you please suggest how I can add rotation for the object onDragStart? |
This issue is about animating final transform - effectively after solid dnd has completed the drop. For your case of rotation you should be able to add and remove appropriate style to the item using the |
wow! Thanks, but seams I mess up a little bit. I’m trying to implement the transform like this
but have no result. |
I added an example to https://solid-dnd.com/ - see the "Custom transform (rotate on drag)" example for a rough approach @membranobruno |
Are there any updates on the on-drop transform issue? I'm willing to hop in if help is needed—this would be great to have. But I'm not sure where to start or where this issue is at. |
No updates - my focus has been elsewhere. I've got a bit more free time currently though so might take another run at it. Happy to have some help :) The approach I want to try next is keeping this animation decoupled from the core. I see the https://github.com/formkit/auto-animate library as a good inspiration. The main challenges are:
Trying to sprinkle the logic to handle this throughout was brittle and confusing. That's why I want to see what an external 'observe and animate' approach could do. |
I see this is a bit stale. Is the author accepting PRs? I don't see a contributing guide or tests in my quick glance. I wouldn't like to invest time if the author is almost done with his implementation. Thanks. |
Hey. Haven't looked at this for a while. Open to PRs though I can be slow to merge them at times 😀 |
Currently the way
onDragEnd
works results in items jumping back to their original position before animating to their new position when a css transition is used for transforms. Investigate how to improve this so that the draggable transitions instead from its current dragged position. Perhaps by not clearing the transform on drag end immediately - instead do it in a queued microtask etc.The text was updated successfully, but these errors were encountered: