feat(drag-and-drop): Allow more flexibility for position of *DragPreview directive relative to mouse position
- Langage dominant
- TypeScript
- Étoiles
- 25k
- Forks
- 6.8k
- Merge moyen
- 1 j 8 h
- PR mergées (30 j)
- 91
Description
### 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
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par les fichiers StackBlitz liés src/app/example-component.html, src/app/example-component.ts et src/app/example-component.css afin de reproduire le comportement de la liste horizontale avec *cdkDragPreview. Suivez ensuite le point d’entrée de Angular CDK drag-preview et comparez le décalage du pointeur avec un glissement sans la prévisualisation. Le travail est terminé lorsque la prévisualisation conserve la position attendue de l’élément par rapport au pointeur.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, typescript
- Domaine
- frontend
- Type d'issue
- Fonctionnalité
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100