bug(form-field): remove hint wrapper when no hint provided
- Dominant language
- TypeScript
- Stars
- 25k
- Forks
- 6.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 91
Description
### 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
Contributor guide
Research direction
Start by reproducing the provided outline mat-form-field example and inspect its generated DOM, especially the mat-form-field-subscript-wrapper element and its spacing. The issue is done when a form field without a hint does not render that wrapper and no unwanted space remains.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100