Multiple mat-icon or mat-icon-button as prefix or suffix are displayed in columns
- Langage dominant
- TypeScript
- Étoiles
- 25k
- Forks
- 6.8k
- Merge moyen
- 1 j 8 h
- PR mergées (30 j)
- 91
Description
#### 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
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par la reproduction StackBlitz liée et comparez le rendu de prefix et suffix de mat-form-field entre les apparences legacy et non-legacy. Confirmez que plusieurs éléments mat-icon ou mat-icon-button s’affichent sur une ligne, et vérifiez que le comportement est cohérent pour toutes les apparences concernées.
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
- 35/100