angular / angular/components

Allow to create cdkDragPreview from the drag drop service

Aperta
#16,111 3 commenti 3 reazioni 0 assegnatari Vedi su GitHub
area: cdk/drag-drop feature P3
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

#### 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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia leggendo il drag-drop service e gli entry point cdkDragPreview, cdkDragPlaceholder, cdkDropList, dragstart e drop descritti nell’issue. Determina il ciclo di vita previsto e la proprietà di Base e Preview al di fuori di un cdkDropList, incluso ciò che dovrebbe accadere dopo il drop. Il lavoro è completato quando il comportamento dell’API e le regole di pulizia sono chiaramente definiti e supportati per il caso d’uso indicato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.