Skip to content

Commit

Permalink
fix(material/form-field): update outline gap when prefix changes
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.
  • Loading branch information
crisbeto committed Nov 2, 2021
1 parent 202c667 commit 93a8d48
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 93a8d48

Please sign in to comment.