angular / angular/components

bug(CdkDrag): Drag preview doesn't work well with sticky elements and scrolling

Abierto
#25,283 4 comentarios 1 reacción 0 asignados Ver en GitHub
area: cdk/drag-drop P3
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

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

if the `cdkDrag` directive is applied on an element inside a container with `position: sticky`, scrolling will reposition the drag preview element. this is especially undesired for configurations such as `[cdkDropListLockAxis]="'x'"` and `[cdkDropListOrientation]="'horizontal'"`

### Reproduction

https://stackblitz.com/edit/components-issue-rtfk83?file=src/app/example-component.html

Steps to reproduce:
1. hold mouse down on element that contains "foo"
2. drag a little bit, then scroll vertically while holding the drag
3. should see the drag preview reposition even though "lock axis" is configured

### Expected Behavior

should not reposition vertically

### Actual Behavior

repositions vertically

### Environment

- Angular: 13.3.0
- CDK/Material: 13.3.0
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): macOS

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con la reproducción vinculada de StackBlitz e inspecciona el comportamiento de CDK drag preview cuando el elemento arrastrado está dentro de un sticky container. Reproduce el reposicionamiento vertical al desplazarte con lock axis y horizontal orientation configurados. El trabajo estará terminado cuando la preview permanezca fija verticalmente durante el drag y el comportamiento horizontal existente siga intacto.

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
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
42/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.