bug(virtual-scroll): scrollToIndex does not work for multiple viewports scrolling over the same element
- 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 you have multiple viewports beneath eachother the function 'scrollToIndex' does not work if you want to scroll to an element in one of the bottom lists. It scrolls to a wrong position.
### Reproduction
StackBlitz link: https://stackblitz.com/edit/components-issue-dch1m4?file=src%2Fapp%2Fexample-component.html,src%2Fapp%2Fexample-component.ts,src%2Fapp%2Fexample-component.css
Steps to reproduce:
1. Click the button 'Scroll to viewport 3 and index 7'
2. It scrolls to the wrong position.
### Expected Behavior
It should scroll to the correct position.
### Actual Behavior
It should scroll to the wrong position.
### Environment
- Angular: 16.2.1
- CDK/Material: 16.2.1
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Stackblitz
Guía de contribución
Línea de trabajo
Comienza con la reproducción enlazada de StackBlitz, especialmente con src/app/example-component.html y src/app/example-component.ts, y ejecuta los pasos para desplazarte hasta viewport 3 e index 7. Sigue el comportamiento de virtual-scroll para varios viewports que comparten un elemento y compara la posición resultante con el objetivo esperado. Se considera terminado cuando el botón se desplaza hasta el elemento correcto en el viewport inferior.
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
- 35/100