angular / angular/components

Support providing multiple drag placeholders

Open
#14,539 7 comments 22 reactions 0 assignees View on GitHub
area: cdk/drag-drop feature needs: discussion P4
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

#### Please describe the feature you would like to request.
Currently there is one type of place holder, the one that's defined with the `*cdkDragPlaceholder` directive.
However the destination container might display the `cdkDrag` item different than the original container.

You can see the issue in here:
https://stackblitz.com/edit/angular-terlwz

If you'll try to drag to the done list the place holder there doesn't show the right layout of the component if it would be dropped.

#### What is the use-case or motivation for this proposal?
I need to take item from one container with a certain layout, and drop the element in other container with different layout. since the layout is different and the way the drag item is viewed in the container is different I suppose the place holder also need to be different.

#### Is there anything else we should know?
I'm also using the drag preview for other feature so I can't use it here.
Maybe the container itself should accept a template for rendering an element that is about to be added.

What do you think?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the behavior in the linked StackBlitz example and reading the drag placeholder directive and destination container behavior. Done means a dragged item can use a placeholder layout appropriate to the container it is entering, without relying on the existing drag preview.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.