Skip to content

Commit f87d505

Browse files
committed
fix(material-experimental/mdc-form-field): ensure appearance is valid
1 parent 79797a4 commit f87d505

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/material-experimental/mdc-form-field/form-field.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ export class MatFormField
211211
}
212212
set appearance(value: MatFormFieldAppearance) {
213213
const oldValue = this._appearance;
214-
this._appearance = value || this._defaults?.appearance || DEFAULT_APPEARANCE;
214+
this._appearance = ['fill', 'outline'].includes(value)
215+
? value
216+
: this._defaults?.appearance || DEFAULT_APPEARANCE;
215217
if (this._appearance === 'outline' && this._appearance !== oldValue) {
216218
this._refreshOutlineNotchWidth();
217219

0 commit comments

Comments
 (0)