feat(drag-and-drop): Allow more flexibility for position of *DragPreview directive relative to mouse position
- Lingua principale
- TypeScript
- Stelle
- 25k
- Fork
- 6.8k
- Merge medio
- 1g 8h
- PR unite (30g)
- 91
Descrizione
### Is this a regression?
- [ ] Yes, this behavior used to work in the previous version
### The previous version in which this bug was not present was
_No response_
### Description
When I use the drag preview directive `*cdkDragPreview` for my horizontal list, the dragged item position is wrong
Possibly related #16171
### Reproduction
[StackBlitz link](https://stackblitz.com/edit/components-issue-1y4nnz?file=src%2Fapp%2Fexample-component.html,src%2Fapp%2Fexample-component.ts,src%2Fapp%2Fexample-component.css)
### Expected Behavior
`*cdkDragPreview` dragging position should be the same as the dragging position is without using `cdkDragPreview`
### Actual Behavior
The dragging position always started from the pointer edge, giving a undesired behavior
### Environment
- Angular: v16
- CDK/Material: v16
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): All
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia dai file StackBlitz collegati src/app/example-component.html, src/app/example-component.ts e src/app/example-component.css per riprodurre il comportamento dell’elenco orizzontale con *cdkDragPreview. Poi segui il punto di ingresso di Angular CDK drag-preview e confronta l’offset del puntatore con il trascinamento senza l’anteprima. Il lavoro è completato quando l’anteprima mantiene la posizione prevista dell’elemento rispetto al puntatore.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- angular, typescript
- Ambito
- frontend
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100