Closed
Description
Description
Some logic in updateOutlineGap skips recalculation when the label content is falsy. This prevents the outlineGap from updating when the label is cleared. It seems like the same logic also prevents the outline gap from updating when the label is removed altogether. In these cases, instead of just returning, the outline should be restored to default.
Reproduction
https://stackblitz.com/edit/angular-nmdjyj
Steps to reproduce:
- Have a form-field with appearance="outline" and a mat-label
- After loading and outline gap is calculated, set the contents of the mat-label to ""
Expected Behavior
Focusing the form-field should show no outline gap
Actual Behavior
Focusing the form-field should shows an outline gap
Environment
- Angular:
- CDK/Material:
- Browser(s):
- Operating System (e.g. Windows, macOS, Ubuntu):