bug(mat-form-field): form field with mat-label and without mat-label not vertically aligned
- Lenguaje dominante
- TypeScript
- Estrellas
- 25k
- Forks
- 6.8k
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 91
Descripción
### Is this a regression?
- [X] Yes, this behavior used to work in the previous version
### The previous version in which this bug was not present was
14
### Description
When two mat-form-fields are in a div and one has a mat-label while the other one hasn't, the fields are not aligned vertically.
The `display` property on `.mat-form-field` was changed from `inline-block` to `inline-flex`. Changing it back seems to solve the issue.
### Reproduction
https://stackblitz.com/edit/cjzlva?file=src%2Fapp%2Fform-field-overview-example.html
### Expected Behavior
Form fields are aligned vertically
### Actual Behavior
Forms fields are not aligned
### Environment
- Angular: 15.2.9 / 16.0.1
- CDK/Material: 15.2.9 / 16.0.1
- Browser(s): Chrome 113 / FireFox 113
- Operating System (e.g. Windows, macOS, Ubuntu): Windows
Guía de contribución
Línea de trabajo
Abre la reproducción vinculada de StackBlitz y compara los dos mat-form-fields; después, inspecciona la regla display de .mat-form-field, que cambió de inline-block a inline-flex. Confirma la corrección comprobando que los campos con y sin mat-label se alineen verticalmente en las versiones y los navegadores de Angular Material indicados.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- angular, css, 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