Skip to content

Commit 76c3fb6

Browse files
authored
fix(mdc-form-field): refresh notch width when toggling appearances (#18776)
* fix(material-experimental/mdc-form-field): refresh notch width when toggling appearances Previously, switching between outline and filled appearance caused the notch width to be incorrect in some situations. This is because then notched-outline component does not sync with the underlying MDC component in case width and open state have been set upon `ngOnInit`. * refactor(material/material-experimental): reduce specificity of textarea overrides selector
1 parent 531ea7c commit 76c3fb6

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/material-experimental/mdc-form-field/_mdc-text-field-textarea-overrides.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
@mixin _mat-mdc-text-field-textarea-overrides() {
1313
// Ensures that textarea elements inside of the form-field have proper vertical spacing
1414
// to account for the floating label. Also ensures that there is no vertical text overflow.
15-
// TODO(devversion): remove extra specificity if we removed the ":not(outline-appearance)"
16-
// selector from the structure overwrites. Blocked on material-components-web#5326.
17-
.mat-mdc-form-field > .mat-mdc-text-field-wrapper .mat-mdc-form-field-infix
1815
.mat-mdc-textarea-input {
1916
resize: vertical;
2017
box-sizing: border-box;

src/material-experimental/mdc-form-field/directives/notched-outline.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ export class MatFormFieldNotchedOutline implements AfterViewInit, OnChanges, OnD
6262
// that we cannot extend from the "MDCNotchedOutline".
6363
this._mdcNotchedOutline = MDCNotchedOutline.attachTo(this._elementRef.nativeElement);
6464
}
65+
// Initial sync in case state has been updated before view initialization.
66+
this._syncNotchedOutlineState();
6567
}
6668

6769
ngOnChanges() {

0 commit comments

Comments
 (0)