angular / angular/components

mat-icon shows text before showing properly

Aperta
#12,171 29 commenti 52 reazioni 0 assegnatari Vedi su GitHub
area: material/icon feature P4
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

#### Bug, feature request, or proposal:
Bug or feature request.

#### What is the expected behavior?
When using `home`, nothing should be displayed until the icon is loaded properly. As soon as the icon is loaded, it should render.

#### What is the current behavior?
Depending on the speed of your connection, it is possible, that you see the text (for example `home`) instead of the icon.

#### What are the steps to reproduce?

1. Start the Angular Material Icon example in [Stackblitz](https://stackblitz.com/angular/yogqmggjokx).
It might be better to open it in it's own tab.
2. Open the Developer-Tools (in Chrome) and under the `Network`-Tab choose a very slow network throttling profile. This is needed, as the sample app is very small and therefore the problem is not noticeable with normal connections.
3. Reload the page and wait until it is loaded. You will see something like this:
![image](https://user-images.githubusercontent.com/18258317/42627235-b224a5e2-85cc-11e8-89d9-29b94933423a.png)
After some time it shows the icon:
![image](https://user-images.githubusercontent.com/18258317/42632653-2e332d8c-85de-11e8-95b2-5a18c09c5fcb.png)

#### What is the use-case or motivation for changing an existing behavior?
In an app I am currently working on, this happens pretty often. Even if I only change the route (which does not trigger a reload of the page) I often see the text of the icons before the icon is displayed properly, so it does not seem to be related to the loading of the icon font.

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
I am using @angular/material 6.3.1 together with TypeScript 2.7.2 on a Windows 10 PC.
The problem occures at least on Chrome, Opera, Firefox and Edge.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Riproduci il problema dall’esempio StackBlitz collegato utilizzando un profilo di rete molto lento, concentrandoti sul componente mat-icon e sul suo comportamento di caricamento. Conferma la visualizzazione del testo intermedio e verifica che il comportamento completato mantenga nascosto il testo dell’icona finché l’icona non è pronta in tutti i browser segnalati.

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

Valutazione

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.