angular / angular/components

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

Aperta
#26,133 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area: cdk/scrolling feature P3
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia individuando il punto di ingresso del componente cdk-virtual-scroll-viewport e i test esistenti. Riproduci il caso di dati statici senza altezza, quindi segui come il viewport gestisce le sue dimensioni iniziali. Il lavoro è completo quando il caso di altezza mancante fornisce agli utenti un avviso evidente e intercettabile o un’altra indicazione concordata, invece di non eseguire il rendering di nulla in silenzio.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.