angular / angular/components

Multiple mat-icon or mat-icon-button as prefix or suffix are displayed in columns

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

Descripción

#### Bug:
More than one mat-icon or mat-icon-button as prefix or suffix in a mat-form-field are displayed in columns when appearance is other than 'legacy'.

#### What is the expected behavior?
They should display in row like in 'legacy' appearance.

#### What is the current behavior?
They are displayed in column.

#### What are the steps to reproduce?
https://stackblitz.com/edit/material-multiple-presuffix

#### What is the use-case or motivation for changing an existing behavior?
Behavior is not consistent accros mat-form-field appearances.

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
@angular/material 7.1.0

All browsers.

#### Is there anything else we should know?
I see 2 solutions :
__Solution 1 :__
Remove this two rules :
```
:not(.mat-form-field-appearance-legacy).mat-form-field .mat-form-field-prefix .mat-icon,
:not(.mat-form-field-appearance-legacy).mat-form-field .mat-form-field-suffix .mat-icon {
display: block;
}
:not(.mat-form-field-appearance-legacy).mat-form-field .mat-form-field-prefix .mat-icon-button,
:not(.mat-form-field-appearance-legacy).mat-form-field .mat-form-field-suffix .mat-icon-button {
display: block;
}
```
__Solution 2 :__
Use flexbox for prefix and suffix :
```
.mat-form-field-prefix,
.mat-form-field-suffix {
display: inline-flex;
align-items: center;
}
```

Potentially related issues : #11650, #13094, #13322 & #13592

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comience con la reproducción vinculada de StackBlitz y compare la representación de prefix y suffix de mat-form-field entre las apariencias legacy y non-legacy. Confirme que varios elementos mat-icon o mat-icon-button se muestran en una fila y verifique que el comportamiento sea coherente en todas las apariencias afectadas.

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
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.