Skip to content

[Drag and Drop] Provide an input from where the preview will be attached #14559

@gonzadk

Description

@gonzadk

Bug, feature request, or proposal:

A new input to provide a DOM element to attach the cdkDragPreview element

What is the expected behavior?

Provide a new input to select a DOM element different than the body to attach the cdkDragPreview element

What is the current behavior?

There is no way to attach the cdkDragPreview item (default or not) to a different element than the body

What are the steps to reproduce?

  • Start a dragging on an element
  • The preview of the dragged element is attached as a child of the body

What is the use-case or motivation for changing an existing behavior?

We are using Angular as a dependency of an inner source project.. And we need to support different themes but the element where the preview is attached could make that the preview item doesn't looks like we expected on some projects because of their particular soluction

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

We are using v7.1.1 of Angular and the rest of their dependencies

Is there anything else we should know?

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/drag-dropfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions