angular / angular/components

Allow to create cdkDragPreview from the drag drop service

Abierto
#16,111 3 comentarios 3 reacciones 0 asignados Ver en GitHub
area: cdk/drag-drop feature P3
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

#### Feature Description

Allow the creation of cdkDragPreview elements outside of a cdkDropList.

#### Use Case

I would like to be able to drag an element Base from a zone A to a zone B, with a preview without losing the place Base was in.

On the event `dragstart` a call to DragDrop (for example) would allow me to duplicate Base or another template element passed to the creation method.
That element Preview would be draggable and would follow the cursor. Base would act as a cdkDragPlaceholder and preview as a cdkDragPreview.

On the event `drop`, I would handle myself what needs to be done. In my case, I only want to get the position of the event, which I can easily do as it's native.
Ideally, we would keep a reference to the element Base to be able to delete it at that point.

I can see difficulties on what to do of Preview or Base by default here. Should Base disappear and Preview stay at the end of the body? Should Preview get nested somewhere where it got dropped? I have no answers here.

I see this as a follow-up to #14261, in that it is a purely cdk request for all DOM nodes.

Thank you

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Empieza leyendo el drag-drop service y los puntos de entrada cdkDragPreview, cdkDragPlaceholder, cdkDropList, dragstart y drop descritos en el issue. Determina el ciclo de vida previsto y la propiedad de Base y Preview fuera de un cdkDropList, incluido lo que debe ocurrir después del drop. Se considera terminado cuando el comportamiento de la API y las reglas de limpieza están claramente definidos y respaldados para el caso de uso indicado.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
angular, typescript
Área
frontend
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.