Skip to content

Commit

Permalink
fix(material/form-field): update outline gap when prefix changes (#23869
Browse files Browse the repository at this point in the history
)

The position of the outline gap depends on the size of the prefix, but we weren't set up to update it when that happens.

Fixes #23863.

(cherry picked from commit a6d4141)
  • Loading branch information
crisbeto authored and amysorto committed Nov 8, 2021
1 parent e8a6eed commit 5d49df1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/material/form-field/form-field.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
</div>
</ng-container>

<div class="mat-form-field-prefix" *ngIf="_prefixChildren.length">
<div
class="mat-form-field-prefix"
*ngIf="_prefixChildren.length"
(cdkObserveContent)="updateOutlineGap()"
[cdkObserveContentDisabled]="appearance != 'outline'">
<ng-content select="[matPrefix]"></ng-content>
</div>

Expand Down

0 comments on commit 5d49df1

Please sign in to comment.