angular / angular/components

feat(cdk/scrolling): Scroll functions silently fail if the viewport is not yet fully initialized

Abierto
#23,716 2 comentarios 2 reacciones 0 asignados Ver en GitHub
area: cdk/scrolling feature P4
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

#### Feature Description

`cdk-virtual-scroll-viewport`'s `scrollTo...` functions (like `scrollToIndex`) silently fail when the viewport is not yet initialized. Technically the functions are doing nothing wrong from a code standpoint, but since the component is not yet fully initialized, it is empty, so trying to scroll will do nothing meaningful. Sending back an error (or at least logging a warning to the console) if an empty viewport is scrolled would be helpful so that developers know that something went wrong.

This would be mitigated if we had an async option that managed the timing of scroll commands. See [this feature request](https://github.com/angular/components/issues/23715).

#### Use Case

This would improve every use case of the virtual scroller.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza en los puntos de entrada scrollTo... de cdk-virtual-scroll-viewport e inspecciona cómo se representan la inicialización y un viewport vacío. Confirma con los maintainers si el comportamiento final debe ser un error o una advertencia en la consola, y añade cobertura específica que demuestre que desplazarse antes de la inicialización ya no falla silenciosamente.

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

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.