hello-pangea / dnd

Beautiful and accessible drag and drop for lists with React.
https://dnd.hellopangea.com
Other
2.06k stars 87 forks source link

Keep draggable in the home list when cloned #712

Open orestis opened 10 months ago

orestis commented 10 months ago

Description

When cloning an element, it would be useful to have the option for the source Draggable to stay in the list.

This pattern is generally useful if you want to have a "source" list of items that can be dragged over a "target" list of items, but the source list itself is e.g. a gallery of widgets that can be added to a form. It doesn't make sense to remove the widget from the gallery, as the widgets never run out.

michaelpginn commented 9 months ago

+1, do you have a workaround for this in the meantime?

orestis commented 9 months ago

+1, do you have a workaround for this in the meantime?

Unfortunately no workaround that I could find.

michaelpginn commented 9 months ago

+1, do you have a workaround for this in the meantime?

Unfortunately no workaround that I could find.

I have a hacky solution where I render the items without dnd, and then render the Draggable versions directly on top and set opacity to 0. Then, you can provide a custom renderClone implementation to make the object visible while dragging.

orestis commented 9 months ago

The best kind of workaround! Much appreciated @michaelpginn 😄