CDK Drag and Drop: Nested Drag and Drop does not allow sorting on same level
See original GitHub issueReproduction
StackBlitz: https://stackblitz.com/edit/angular-wfrzq9
Steps to reproduce:
- Switch ‘child a’ and ‘child b’
- Directly switching a and b will fail
- Workaraound in the example: Drag child b after Parent_2 and drag it again into the list before child a
Expected Behavior
Dragging within the inner cdkDropList should work, the outher cdkDropList should only fire if the element is moved out of its list.
Actual Behavior
The inner cdkDropList does listen to the drag - the outer list is called.
might be caused by
components/src/cdk/drag-drop/directives/drop-list.ts 304:
ref.connectedTo(siblings.filter(drop => drop && drop !== this).map(list => list._dropListRef))
Environment
- Angular: 9.0.0
- CDK/Material: 9.0.0
- Browser(s): Chrome 80.0.3987.87
- Operating System (e.g. Windows, macOS, Ubuntu): Win 10
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
nested drag and drop with same sorting angular
I am developing a module which has section, subsection and questions. there I need drag and drop feature so a user can drag...
Read more >Angular CDK nested Drag And Drop - Ernestas Buta - Medium
After gruelling research, I discovered that the DragAndDrop module does not support nested lists and using SortableJS was not an option. After a ......
Read more >Angular Material Drag and Drop – Strengths and Limitations
In the CDK Drag and Drop Module, the placeholder is associated with the drag item rather than the destination drop list.
Read more >Angular CDK: Sorting Items using Drag & Drop - This Dot Labs
In this blog post, we'll see a practical example to allow sorting Items using Drag and Drop considering a single and a mixed-orientation...
Read more >Drag and Drop | Angular Material
Passing an alternate root element is useful when trying to enable dragging on an element that you might not have access to. @Output('cdkDragDropped')....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I spent a bit of time on this, but it looks like it’ll be tricky if we want to cover all the cases. I have a solution that somewhat works here, but there are definitely edge cases that it won’t cover.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.