-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Drag and drop with nested lists #293
Comments
We're having the same issue, but with nested vertical lists. I see it's working in the StoryBook demo. Having access to that code would be helpful. |
All the source code for the examples is here: https://github.com/atlassian/react-beautiful-dnd/tree/master/stories |
I suspect the example is a setup issue. I'll try to take a look at it soon |
I think I know what your issue might be. The parent is of the same |
The functionality works as you can see in our example. I am attempting to trace through your app to see what is going wrong |
Okay, you had a few issues:
I have done a small fix here: Also, you are getting spacing issues due to using inline-flex. It does not play well with standard margin collapsing |
@alexreardon that link for your fix looks like it's still the original non-working code. Do you have another fork? |
Whoops, here it is: https://codesandbox.io/s/vmm0nplz5y |
@alexreardon have a question about this case: |
@alexreardon,
|
Sorry to pop in so late in the discussion, but can anyone confirm whether this is currently impossible? It's sorta my own fault but I went ahead and built my app assuming it'd be able to tackle something like this, and now I'm not sure what my options are. |
@alexreardon thanks for the demo https://codesandbox.io/s/vmm0nplz5y for nested drag and drop. But I have a question about this. is that possible to have different event onDragEnd={this.onDragEnd}. My sub component is not the same function as a parent, so sharing this event function is not workable for my work. example |
@wesleywong looks similar to #498 |
If this helps anyone - https://codesandbox.io/s/5v2yvpjn7n Explanations can be found here - https://stackoverflow.com/questions/52814011/nested-drag-and-drop-with-react-beautiful-dnd/54970040#54970040 |
https://codesandbox.io/s/vmm0nplz5y is not working for horizontal |
@nielsDom got the same problem |
Thanks @debo07 , you just made my day. |
I followed @debo07's answer, anyone else getting this warning messange?
|
@ColdTuna Sounds like you have nested scroll containers, maybe scrolling at an overall level and scrolling inside each of your lists. That's a different issue to this, #131 |
You're a hero for real mate |
@alexreardon and in your case, you got items in horizontal dnd with using getItems() function. |
https://codesandbox.io/s/5v2yvpjn7n |
@dev-assassin I worked on something similar for nested lists recently and it worked. So I created this minor project to help explain what I did. I hope this helps. |
@dunchaseme |
@debo07 Thank you so much for this. I have few additional use cases here :- I tried by not setting the type for any of the Droppable but the css was drastically disturbing the moment I start slight dragging of any of the nested item. Can you please suggest how I can achieve this ? This is really needed for my project and in high priority. Thanks in advance ! @alexreardon Please provide your valuable suggestions here. My use case is pretty similar to #1001 |
@Tush2890 I worked on both use cases with horizontal lists in my earlier comment. Was that helpful? |
how i can aplly this logic with data has 4 levels ? |
@collab-with-tushar-raj @alexreardon @DeolaJ @debo07 @tnhu Depth 0 question is : Do you have Card?? Now in Depth 0(Root Level) I can easily reorder the questions also in Depth 1(Child Level) I can easily reorder the questions with the help of react-beautiful-DND but after child level I mean after depth 1 in Any depth i am not able to reorder the questions or items with DND . Getting wrong destination in when i tried to reorder nested child from depth 2 , but perfectly working in depth 1. |
Bug or feature request?
Could be both.
Expected behavior
I have a nested list, DnD needs to be available on both the container and its content. The container is a vertical dnd list. The content of the container is another nested horizontal dnd list.
If put separately, they work fine.
When nested, vertical dnd works on the container level, but the horizontal dnd list does not.
I searched through this repository issues, but did not find an easy solution. Any hint would be much appreciated.
Actual behavior
Nested dnd is not working.
Steps to reproduce
Please look into codesandbox link below.
Browser version
Chrome 63/Mac.
Demo
https://codesandbox.io/s/1r48641304
The text was updated successfully, but these errors were encountered: