bug(form-field): remove hint wrapper when no hint provided
- Vorherrschende Sprache
- TypeScript
- Sterne
- 25k
- Forks
- 6.8k
- Ø Merge
- 1 T. 8 Std.
- Gemergte PRs (30 T.)
- 91
Beschreibung
### Is this a regression?
- [ ] Yes, this behavior used to work in the previous version
### The previous version in which this bug was not present was
_No response_
### Description
Even when no hint is provided, the hint-wrapper dom element still shows up.
This is because `mat-form-field-subscript-wrapper` has a margin as specified here:
```CSS
.mat-form-field-subscript-wrapper {
font-size: $subscript-font-size;
margin-top: $subscript-margin-top;
```

### Reproduction
Steps to reproduce:
1. Add an outline material form field without any hint and inspect.
eg:
```HTML
Outline form field
```
### Expected Behavior
When no hint is being provided, the wrapper dom element shouldn't render.
### Actual Behavior
The wrapper renders and takes up space.
### Environment
- Angular: 13.3.5
- CDK/Material: 13.3.5
- Browser(s): Chrome / all
- Operating System (e.g. Windows, macOS, Ubuntu): macOS/ all
Beitragsleitfaden
Rechercherichtung
Beginne damit, das bereitgestellte outline-mat-form-field-Beispiel nachzustellen und sein generiertes DOM zu untersuchen, insbesondere das Element mat-form-field-subscript-wrapper und seine Abstände. Das Issue ist abgeschlossen, wenn ein Formularfeld ohne Hinweis dieses Wrapper-Element nicht rendert und kein unerwünschter Leerraum verbleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- angular, typescript
- Bereich
- frontend
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 68/100