angular / angular/components

Warning message (cdk-virtual-scroll-viewport): When no height is set.

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

Descripción

### Feature Description

I know this is a very insignificant "feature", but I think it will be helpful.

`` require fixed height to be set.
Without height it doesn't render any elements at all (even the html structure stays empty). This can be verry misleading and time consuming in some cases.
I just taked sandbox example with static data and modifyed it to take async data.
I was tired and spend few hours thinking about that is a bug in my code flow (timing, data refreshing or something else).
Today on a fresh mind I realize it's just because it has no height.

Maybe if you just `warn` the user to set height if there is no height or maybe set `min-height` = single element height. This can help to prevent others to make this mistake.

### Use Case

![image](https://user-images.githubusercontent.com/7819492/204823532-93cf3d6c-f705-45ca-9207-f9d6b92f8abb.png)
When we have data and no height - no html is rendered. If there is a `console.warn('there is no height man.')` will be very obviously and catchable.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza localizando el punto de entrada del componente cdk-virtual-scroll-viewport y sus pruebas existentes. Reproduce el caso de datos estáticos sin altura y, después, sigue cómo el viewport gestiona sus dimensiones iniciales. Se considera terminado cuando el caso de altura ausente proporciona a los usuarios una advertencia obvia que se pueda capturar u otra indicación acordada, en lugar de no renderizar nada 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.