You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
When you have a mat form field and the mat-label is conditional. If the view starts with the label and gets remove with @if in template it is perfectly fine. Will disappear and reappear. If the view starts with-out the mat label rendered, the label will get rendered but the component, 'MatFormFieldNotchedOutline" still has the class, 'mdc-notched-outline--no-label', so the display is set to none.
Looks as though if the mat-label is not there on view init it is not responsive.
The behavior works fine with fill appearance.
Reproduction
StackBlitz link:
Steps to reproduce:
1.
2.
Expected Behavior
When mat-label gets rendered in even after init, i.e. Using a structural directive or decorator such *ngIf or @if. The label should show no matter the appearance.
Actual Behavior
When you have the appearance set to outline and the view is initially rendered without the label it is not responsive and will not show up.
Environment
Angular: 18.2.10
CDK/Material: 18.2.10
Browser(s): Edge, Chrom
Operating System (e.g. Windows, macOS, Ubuntu): Windows
The text was updated successfully, but these errors were encountered:
I don't think this is a duplicate of that other bug. That one is only happening on fill appearance while this is happening on the outline appearance. This is a specific issue of what it seems like is in the "ngAfterViewInit" in the MatFormFieldNotchedOutline component. A component that does not even get added when appearance is set to fill.
@Cole-Jaeger thanks for the link, I am able to reproduce the issue
amysorto
added
P4
A relatively minor issue that is not relevant to core functions
and removed
needs: clarification
The issue does not contain enough information for the team to determine if it is a real bug
labels
Nov 1, 2024
Is this a regression?
The previous version in which this bug was not present was
No response
Description
When you have a mat form field and the mat-label is conditional. If the view starts with the label and gets remove with @if in template it is perfectly fine. Will disappear and reappear. If the view starts with-out the mat label rendered, the label will get rendered but the component, 'MatFormFieldNotchedOutline" still has the class, 'mdc-notched-outline--no-label', so the display is set to none.
Looks as though if the mat-label is not there on view init it is not responsive.
The behavior works fine with fill appearance.
Reproduction
StackBlitz link:
Steps to reproduce:
1.
2.
Expected Behavior
When mat-label gets rendered in even after init, i.e. Using a structural directive or decorator such *ngIf or @if. The label should show no matter the appearance.
Actual Behavior
When you have the appearance set to outline and the view is initially rendered without the label it is not responsive and will not show up.
Environment
The text was updated successfully, but these errors were encountered: