Skip to content

bug(CdkDragDrop): cdkDropListOrientation="mixed" reports wrong currentIndex #31505

Open
@xeladotbe

Description

@xeladotbe

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Drop Event returns the wrong currentIndex if you drag the element straight up to another list and back to the original position

Reproduction

StackBlitz link: https://stackblitz.com/edit/4gs3gqno?file=src%2Fexample%2Fcdk-drag-drop-disabled-sorting-example.html,src%2Fexample%2Fcdk-drag-drop-disabled-sorting-example.ts
Steps to reproduce:

  1. drag Bananas from the list straight up into the other list (Cucumbers moves to index 1)
  2. drag the element straight down again to the old position in the list and release

Expected Behavior

drop event reports previousIndex = 1, currentIndex = 1 as there was no change of position

Actual Behavior

drop event reports previousIndex = 1, currentIndex = 2

Environment

  • Angular: 20
  • CDK/Material: 20
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows, macOS, Ubuntu

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions