angular / angular/components

mat-icon shows text before showing properly

Ouverte
#12,171 29 commentaires 52 réactions 0 personnes assignées Voir sur GitHub
area: material/icon feature P4
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Reproduisez le problème de l’exemple StackBlitz lié en utilisant un profil réseau très lent, en vous concentrant sur le composant mat-icon et son comportement de chargement. Confirmez l’affichage du texte intermédiaire et vérifiez que le comportement final garde le texte de l’icône masqué jusqu’à ce que l’icône soit prête dans tous les navigateurs concernés.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
frontend
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
42/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.