You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Transform transition on sortables bugged in Board example? #112
In short, haven't got this supported yet. I tried a while back to think about how to better support animation / transition but didn't get to a solution. One day I might give it another go.
Hey Martin, thanks for the fast response, I found an ugly workaround which seems to work without touching the lib - using this inline style on the sortable element for now.
edit: fixes the re-triggering while dropping, but there's a problem in case of dragging back without dropping the other sortables directly snap back in place without any transition/animation.
anyway that's all for now, I'll wait for support or try to see if I can fix it in the lib
Thanks
Activity
martinpengellyphillips commentedon Jun 20, 2024
In short, haven't got this supported yet. I tried a while back to think about how to better support animation / transition but didn't get to a solution. One day I might give it another go.
paxee commentedon Jun 21, 2024
Hey Martin, thanks for the fast response, I found an ugly workaround which seems to work without touching the lib - using this inline style on the sortable element for now.
style={{...maybeTransformStyle(sortable.transform),
transition: (sortable.isActiveDraggable || sortable.isActiveDroppable)
? 'transform 360ms cubic-bezier(0.25, 0.46, 0.45, 0.94)'
: '',
}}
edit: fixes the re-triggering while dropping, but there's a problem in case of dragging back without dropping the other sortables directly snap back in place without any transition/animation.
anyway that's all for now, I'll wait for support or try to see if I can fix it in the lib
Thanks
paxee commentedon Mar 22, 2025
Update:
const [state]: any = useDragDropContext(); // Get the statesolution 1. via class:
solution 2. via inline style only:
These are fully functional solutions which will add transition for items to smoothly animate their transforms. ✌
Looking forward to exploring a lib based integration.