Skip to content

cdkDrag inside drop list doesn't preserve transform value #22407

Closed
@anirudhvarma12

Description

@anirudhvarma12

What are you trying to do?

I am trying to absolutely position draggable elements inside a drop container using transform. Something like -

<div [style.transform]="transformString" cdkDrag>...</div>

Before upgrading to cdk v9, this worked perfectly. However, after upgrading, it seems like the transform style is overwritten by the CDK.

What troubleshooting steps have you tried?

After some digging, it seems like this code is performing the reset.

I tried using cdkDragFreeDragPosition, but that only works in the absence of a drop container.

It also seems like this PR, should fix the issue?

Is there any other recommended way of setting this?

What are you seeing that does not match your expectations?

Reproduction

N/A

Environment

  • Angular: 9.1.4
  • CDK/Material: 9.2.4
  • Browser(s): Firefox
  • Operating System (e.g. Windows, macOS, Ubuntu): MacOS Catalina

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