Skip to content

bug(CDK/drag-drop): cdkDropListSortingDisabled not working correctly if the list appears in html after the other #21907

@blubiszirp

Description

@blubiszirp

Reproduction

Use StackBlitz to reproduce your issue:

Steps to reproduce:

  1. Drag a item from List 2 (cdkDropListSortingDisabled & not the first item) into List 1 (without dropping it)
  2. Drag it back into List 2 (still Dragging)
  3. The preview drop position in List 2 is at old position - 1 (but should be position +- 0)

Expected Behavior

The preview position appears at the same position as the drag starting position (like the 2nd example (working correctly))

Actual Behavior

The preview position appears at the (position - 1) instead of the drag starting position

Conclusion

If the list with cdkDropListSortingDisabled set appears in .html file after the other connected list the drop position on the 'cdkDropListSortingDisabled-List' (after dragging it away and back into that list) is one less than the starting position

Environment

  • Angular: 11.2.0
  • CDK/Material: 11.2.0
  • Browser(s): Chrome
  • Operating System: Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/drag-drop

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions