angular / angular/components

mat-icon shows text before showing properly

Abierto
#12,171 29 comentarios 52 reacciones 0 asignados Ver en GitHub
area: material/icon feature P4
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Reproduce el problema del ejemplo enlazado de StackBlitz utilizando un perfil de red muy lento y centrándote en el componente mat-icon y su comportamiento de carga. Confirma la visualización del texto intermedio y verifica que el comportamiento completado mantenga oculto el texto del icono hasta que el icono esté listo en todos los navegadores indicados.

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

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.