atlassian / react-beautiful-dnd

Beautiful and accessible drag and drop for lists with React
https://react-beautiful-dnd.netlify.app
Other
33.39k stars 2.57k forks source link

Feature request: Make multi-drag elements show as a "pile" #923

Closed JReinhold closed 5 years ago

JReinhold commented 6 years ago

Bug or feature request?

Feature request

Multi drag piles

This library is highly based on great philosophical and UX decisions, which have set the tone for how the library functions. This is great, and with this feature request I want to expand on that.

Currently in the examples, when dragging multiple elements, the number of elements are shown in the top right hand corner of the Draggable. this is great from a user's perspective, but it doesn't really translate to the real world. When we move multiple things in the real world, say papers, we move a "pile" (or stack) of things. I think it would be great to simulate this feeling of the "pile". We could show duplicates of the Draggable underneath the original, to simulate this.

Below is a quick mock-up I've made to explain what I'm trying to say. multi-drag-pile

I think this would fit perfectly into the whole physicality philosophy that drives this library.

Technical challenges

How would we render the "duplicates" underneath?

  1. I don't think we can just render the main component multiple times, because they could have side effects in userland, eg. the Draggable fetching stuff on mount.
  2. Can we copy the style of the outer most component that is within the Draggable, so we are just rendering an empty "container" 3 times behind the Draggable? Then how do we manage the size of the empty "container", if it is based on the original content? could we maybe compute the static size on the fly, or would that take a big hit on performance?
  3. Should the style of each element in the pile be given from userland? So the developer have to specify how to render each element in the pile underneath?

As I write this, I may come to the conclusion that rendering the pile might not be the responsibility of this library, but something that is implemented in userland. But should we then at least provide an example of the feature, in Storybook?

Anyway, this was just a braindump, I'd love to get input on this!

alexreardon commented 5 years ago

I don't think it would be in the core library and multi-drag is a pattern. But it might be possible to do as an addon

alexreardon commented 5 years ago

Challenges:

alexreardon commented 5 years ago

We are closing this issue due to inactivity. If you would like to continue the conversation feel free to reply to this issue and we can reopen it if needed.