kutlugsahin / smooth-dnd

drag and drop library for javascript
MIT License
599 stars 147 forks source link

It's possible to use multi drag? #30

Closed larissathasdefar closed 5 years ago

larissathasdefar commented 5 years ago

I would like to know if it's possible to select and move more than one item at the same time.

Is that possible?

kutlugsahin commented 5 years ago

Unfortunately not. Only one at a time.

larissathasdefar commented 5 years ago

I would like to share how I manage to "simulate" the multi drag.

First of all, every time I clicked on a card, I concatenated on state the id of the card and updated the style to looks like its selected, as the gif below. When the drag starts, I change the opacity in the card style.

After that, on my onDrag function, I removed every card with the id on state and added them to the position where the dragged card was dropped, simulating the multi drag only with styles and state updates on my component.

multidrag