question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CDK Drag and Drop: Nested Drag and Drop does not allow sorting on same level

See original GitHub issue

Reproduction

StackBlitz: https://stackblitz.com/edit/angular-wfrzq9

Steps to reproduce:

  1. Switch ‘child a’ and ‘child b’
  2. 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
crisbetocommented, Feb 15, 2020

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.

0reactions
angular-automatic-lock-bot[bot]commented, Aug 12, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found