react-beautiful-dnd icon indicating copy to clipboard operation
react-beautiful-dnd copied to clipboard

Proposal: merge @atlaskit/tree into react-beautiful-dnd

Open ianschmitz opened this issue 6 years ago • 16 comments

I was debating whether to open an issue here or in the @atlaskit/tree tracker, but thought GitHub would be more appropriate since it would get more eyes from the general react-beautiful-dnd community.

At my company we've been a long time user of react-beautiful-dnd since the early versions, and have loved it ever since ❤️. We've been long wanting drag-and-drop tree support from RBD for different use cases, and with the recent preview release of @atlaskit/tree we have that... sort of.

Don't get me wrong, the tree package solves some simple use cases very well, but we've run into issues where I believe having tree support be a core feature of RBD would have avoided:

  • The internal implementation means it isn't possible to have multiple lists. The Tree component renders a DragDropContext and has very specific logic implemented for the onDrag* props. This means we can't drag between multiple trees, or for our specific use case, a flat RBD list to a tree. image
  • The @atlaskit/tree package depends on [email protected], while 11.x is current. We've now got two versions of RBD in our bundle which is unfortunate, unless we hold back on updating RBD, but we can't take advantage of the latest improvements. RBD seems to release major versions on a fairly regular cadence, so i can see this being an ongoing issue.
  • An outstanding bug https://github.com/atlassian/react-beautiful-dnd/issues/1237 which would have likely been caught prior.
  • Doesn't selectively set isNestingEnabled (which internally sets isCombineEnabled on the Droppable) for individual tree items based on the value of the item's hasChildren. For example if thinking about a file/folder tree structure, it doesn't make sense to drop a file onto another file, but it does make sense to drop a file onto a folder to be a child of that folder. In my picture example above, the blue items represent items with hasChildren: true, and the grey items are hasChildren: false. I handle this in code currently to ignore drops on items that don't support children, but it makes for an awkward drop animation

My proposal is to merge the tree support as a proper feature of RBD. Looking through the source code of tree, i don't foresee this being a huge challenge, but i may have overlooked some things.

Thanks for considering and for creating react-beautiful-dnd!

ianschmitz avatar Apr 25 '19 20:04 ianschmitz

The @atlaskit/tree package depends on [email protected], while 11.x

This should be resolved soon. We are about to bump Atlaskit to react 16.x /cc @petegleeson

The internal implementation means it isn't possible to have multiple lists.

This would be a valid feature to add to tree for sure. @balnagy is there an issue for this?

merge the tree support as a proper feature of RBD

This is interesting and worth more thought. Perhaps we could move to a multi package setup 🤔

alexreardon avatar Apr 25 '19 23:04 alexreardon

can i make osx finder or windows explorer like feature use rbd for now?

its two different view but the left side should be a tree like this one

image

image

left side tree can be reorganization

crapthings avatar Apr 29 '19 01:04 crapthings

This is interesting and worth more thought. Perhaps we could move to a multi package setup

Yeah that could work!

There may be some ways that we could tweak the tree API to be more consistent with RBD. The current API is fairly simple, but is quite a bit different than the Droppable/Draggable rendering pattern of RBD.

ianschmitz avatar Apr 29 '19 02:04 ianschmitz

@alexreardon Here is the Atlaskit ticket for multiple tree feature.

balnagy avatar Apr 29 '19 03:04 balnagy

Is there an update on this? I would love to see this be made a proper feature of RBD.

mheavenor avatar Aug 20 '19 22:08 mheavenor

I'm currently having exactly the same issue implementing a similar use case - a single level list with draggable items on one side and a tree structure with reorderable items on the other side.

Is there any update on this topic?

Thanks.

Amheklerior avatar Sep 11 '19 11:09 Amheklerior

For example if thinking about a file/folder tree structure, it doesn't make sense to drop a file onto another file, but it does make sense to drop a file onto a folder to be a child of that folder.

Wanted to chime in that I'm running into this same issue and wanting some way to conditionally set isNestingEnabled on a per node basis. I'm currently exiting out of onDragEnd based off a custom node property of isFolder, but as @ianschmitz stated, this results in clunky UX.

wrobbinz avatar Sep 19 '19 02:09 wrobbinz

Hi Guys! I have the same case, Is there any update on this topic? Regards!

ph3rn4nd3z avatar Dec 05 '19 16:12 ph3rn4nd3z

I'm really looking forward to multiple tree support feature being implemented, too.

avele avatar Feb 11 '20 19:02 avele

Any updates on this?

nitinreddy3 avatar Mar 18 '20 09:03 nitinreddy3

Hey guys, some one have a solution for this case?

fgandarilla avatar Nov 10 '20 18:11 fgandarilla

Well, I have to admit that I have the same use case and unfortunately that animation would look even more stupid in my case 😅 Is there any progress on that? I know that RBD development was halted by Atlassian for a while and it's a huge bummer, but is there a possibility of at least @atlaskit/tree becoming open-sourced again so anybody could technically fork it and make needed changes?

DeviousM avatar Dec 17 '20 10:12 DeviousM

Hay, is react-beautiful-dnd suport for handle tree item drag drop ? if posible, can you give me the example. thanks.

Rendydendimara avatar Mar 06 '21 07:03 Rendydendimara

related: https://github.com/atlassian/react-beautiful-dnd/issues/1547

danieldelcore avatar Mar 23 '21 04:03 danieldelcore

Any updates on this?

Pines-Cheng avatar Feb 22 '22 06:02 Pines-Cheng

The @atlaskit/tree package depends on [email protected], while 11.x

This should be resolved soon. We are about to bump Atlaskit to react 16.x /cc @petegleeson

That might have been resolved back in 2019, but with newer releases, the same problem has come up again:

$ yarn add react-beautiful-dnd
    ...

installs the latest 13.1.0;

$ yarn add @atlaskit/tree
    ...

installs react-beautiful-dnd-next - which ironically seems to be version 11.0.5.

Bumping versions might be doable with reasonable effort, but there doesn't even seem to be a public @atlaskit/tree repository anymore and any newer versions alone won't add support for dragging from a @atlaskit/tree Tree to a react-beautiful-dnd Droppable.

Well, it's 2022 Q3, this issue has been open for 3+ years with no recent response. Seems to me like Atlassian has abandoned either (or both) projects - and the app I'm currently working on comes to a grinding halt :disappointed:.

dd-ssc avatar Sep 07 '22 19:09 dd-ssc