Skip to content

Commit 08c33c6

Browse files
committed
fix(form-field): change undefined check to a type check
* Internal test was failing because userAriaDescribedBy showed up as an object so calling .split was throwing errors.
1 parent e00e7a1 commit 08c33c6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ export class MatFormField implements AfterViewInit, OnDestroy, AfterContentCheck
584584
if (this._control) {
585585
let ids: string[] = [];
586586

587-
if (this._control.userAriaDescribedBy) {
587+
if (typeof this._control.userAriaDescribedBy === 'string') {
588588
ids.push(...this._control.userAriaDescribedBy.split(' '));
589589
}
590590

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ export class MatFormField extends _MatFormFieldMixinBase
507507
if (this._control) {
508508
let ids: string[] = [];
509509

510-
if (this._control.userAriaDescribedBy) {
510+
if (typeof this._control.userAriaDescribedBy === 'string') {
511511
ids.push(...this._control.userAriaDescribedBy.split(' '));
512512
}
513513

0 commit comments

Comments
 (0)