ValentinH / react-easy-sort

A React component to sort items in lists or grids
https://ValentinH.github.io/react-easy-sort
MIT License
160 stars 25 forks source link

Get to control the transition duration or snap on origin control function ? #42

Closed fzsf163 closed 10 months ago

fzsf163 commented 10 months ago

Is there a way to control the transition duration or control behaviour after drop ?

If I apply transition from outside , entire lay out gets destroyed.

Can we please get an option to control transition duration or snap on origin function. Where we can decide how it will be act after drag completion. Like bounce effect or slower snap to drop zone.

ValentinH commented 10 months ago

This would require quite a lot of changes to the implementation. Indeed, during the drag, we don't move the actual item but a copy of it. When the gesture starts, we clone the item and hide the item. Then, we translate the clone during the gesture. Finally, on drop, we delete the clone and show back the item.

Adding a transition on drop would require 2 things:

fzsf163 commented 10 months ago

Please if possible , implement it. This is one of the best and easiest libs to use for drag and drop.

ValentinH commented 10 months ago

To be honest I haven't used this lib myself recently so I don't feel the need for it. I have other important (personal) priorities at the moment so I won't work on this. However, if someone is willing to work on this, I'd be happy to review a PR.

fzsf163 commented 10 months ago

Okk okk good enough. Thank you so much for making this lib.