bug(form-field): Label overlaps matPrefix in mat-tab-group on tab change #31056
Labels
area: material/form-field
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Is this a regression?
The previous version in which this bug was not present was
No response
Description
When a mat-form-field with appearance="outline" and a matPrefix (e.g., an icon) is placed inside a mat-tab within a mat-tab-group, the mat-label (acting as a placeholder) overlaps with the matPrefix icon after switching tabs.
The issue is typically observed as follows:
This behavior makes the form field difficult to read and use.
Reproduction
StackBlitz link: Link
Expected Behavior
The mat-label (placeholder) of the mat-form-field should always be positioned correctly to the right of the matPrefix icon, without any overlap, regardless of tab switching. The prefix icon should create sufficient space for itself, and the label should respect this space when not floated.
Actual Behavior
After switching to a tab that was not initially active, the mat-label (placeholder) of the mat-form-field incorrectly overlaps with the matPrefix icon. The label does not seem to account for the space occupied by the prefix. This issue is consistently reproducible with the provided minimal reproduction steps.
Environment
Edition Windows Server 2025 Datacenter Evaluation
Version 24H2
OS build 26100.2894
The text was updated successfully, but these errors were encountered: