Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ianschmitz opened this issue Apr 25, 2019 · 16 comments
Open

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

ianschmitz opened this issue Apr 25, 2019 · 16 comments

Comments

@ianschmitz
Copy link
Contributor

ianschmitz commented Apr 25, 2019

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 react-beautiful-dnd@10.x, 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 @atlastkit/tree doesn't add placeholder element #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!

@alexreardon
Copy link
Collaborator

alexreardon commented Apr 25, 2019

The @atlaskit/tree package depends on react-beautiful-dnd@10.x, 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 🤔

@crapthings
Copy link

crapthings commented Apr 29, 2019

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

@ianschmitz
Copy link
Contributor Author

ianschmitz commented Apr 29, 2019

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.

@balnagy
Copy link

balnagy commented Apr 29, 2019

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

@mheavenor
Copy link

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

@Amheklerior
Copy link

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.

@wrobbinz
Copy link

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.

@ph3rn4nd3z
Copy link

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

@avele
Copy link

avele commented Feb 11, 2020

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

@nitinreddy3
Copy link

Any updates on this?

@fgandarilla
Copy link

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

@DeviousM
Copy link

DeviousM commented Dec 17, 2020

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?

@Rendydendimara
Copy link

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

@danieldelcore
Copy link
Collaborator

related: #1547

@Pines-Cheng
Copy link

Any updates on this?

@dd-ssc
Copy link

dd-ssc commented Sep 7, 2022

The @atlaskit/tree package depends on react-beautiful-dnd@10.x, 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 😞.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests