Skip to content

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

Closed
@mmuehlich

Description

@mmuehlich

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions