react-smooth-dnd
react-smooth-dnd copied to clipboard
Can behavior be dynamic?
I'm trying to have a behavior where I have multiple groups of draggable items, and dragging an item within a group reorders it, but dragging an item to a different group does a copy. For example, it seems like the Copy draggable
example could be modified to have this behavior. Currently the behavior prop is a constant so I can't modify it based on the target drop zone.
Another semi-variant of this is to allow copy vs move to be toggled by the Alt
key on a mac, similar to what react-dnd
does here: http://react-dnd.github.io/react-dnd/examples-dustbin-copy-or-move.html
Hi @jfranty Its not supported right now but that sound like a good feature to add. Lets keep this issue open.
But for now if you want make container sortable and if droppped to a certain drop zone copy the item. you can do it keeping the same draggable list for the source container. It does not make sense to change the behavior just before the drop according to the target container since the draggable will be already dragged out of the container. It can only be changed before the drag started. Thats how I plan to modify the feature