Skip to content

bug(@angular/cdk/drag-drop): Grabbing a cdkDrag element with underlying link element cause the link to be grabbed with css transition #24403

Closed
@Raphyyy

Description

@Raphyyy

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

When grabbing an element that just have been dropped, you will get the underlying link to be grabbed instead of the cdkDrag element if you drag from the link.
It only appears if used CSS transition on transform to make smoother moves, so I think the issue is happening when the CSS animation has not ended.
Attaching cdkDrag to a parent element instead of setting it on the element doesn't change a thing. (see difference between the "To do" cdkDropList and the "Done" cdkDropList.

grab_bug

Maybe related issue : https://stackoverflow.com/questions/68924215/cdkdrag-sometimes-grabs-uderlying-link-element

Note : the attached stackblitz run Angular 12.0.0, but the issue also appears on my local with Angular 13.2.2.

Reproduction

Steps to reproduce:

  1. https://stackblitz.com/edit/angular-pqknrn-x92xnv?file=src/app/cdk-drag-drop-connected-sorting-group-example.html
  2. Grab an element, drop it somewhere and quickly regrab-it from the link

Expected Behavior

The underlying link should not be dragged

Actual Behavior

The underlying link is dragged instead of the cdkDrag element

Environment

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

Metadata

Metadata

Assignees

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