bug(mat-form-field): form field with mat-label and without mat-label not vertically aligned
- Vorherrschende Sprache
- TypeScript
- Sterne
- 25k
- Forks
- 6.8k
- Ø Merge
- 1 T. 8 Std.
- Gemergte PRs (30 T.)
- 91
Beschreibung
### 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
Beitragsleitfaden
Rechercherichtung
Öffne die verknüpfte StackBlitz-Reproduktion und vergleiche die beiden mat-form-fields. Untersuche anschließend die display-Regel von .mat-form-field, die von inline-block zu inline-flex geändert wurde. Bestätige den Fix, indem du prüfst, ob Felder mit und ohne mat-label in den gemeldeten Angular Material-Versionen und Browsern vertikal ausgerichtet sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- angular, css, typescript
- Bereich
- frontend
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100