dnd-kit icon indicating copy to clipboard operation
dnd-kit copied to clipboard

There is a problem with the sorting animation for items of different sizes.

Open rnrnstar2 opened this issue 2 years ago • 7 comments

I'm using SortableContext to implement drag functionality. There is a problem with the sorting animation for items of different sizes. Is there any way to fix this?

https://user-images.githubusercontent.com/39724729/202113093-288e6f63-8739-45fc-8a10-607216eb2ad3.mov

rnrnstar2 avatar Nov 16 '22 07:11 rnrnstar2

This official example from the storybook might help you.

For the implementation I guess we have to reverse-engineer the source code of these stories.

RemyMachado avatar Nov 16 '22 12:11 RemyMachado

When you pass the transform prop, just make sure that you sent the resulting scaleY to 1.

transform: CSS.Transform.toString(transform && { ...transform, scaleY: 1 })

kostia1st avatar Dec 08 '22 16:12 kostia1st

Or CSS.Translate.toString() (#817)

larissa-n avatar Mar 06 '23 08:03 larissa-n

I'm wondering why there are scales.

JunYang-tes avatar Mar 07 '23 08:03 JunYang-tes

I'm running into the same issue and am curious as to why there are scales in here as well.

joshbuddy avatar Mar 13 '23 09:03 joshbuddy

such approach helps: const style = { transform: CSS.Translate.toString(transform), transition } as CSSProperties

hexwit avatar May 06 '23 12:05 hexwit

Any updates ?

bekogeko avatar Feb 05 '24 08:02 bekogeko