Skip to content

Commit 9fa0c28

Browse files
committed
fix(form-field): change undefined check to a type check
1 parent c0f59f8 commit 9fa0c28

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,7 @@ export class MatFormField extends _MatFormFieldMixinBase
507507
if (this._control) {
508508
let ids: string[] = [];
509509

510-
if (this._control.userAriaDescribedBy &&
511-
this._control.userAriaDescribedBy.split) {
510+
if (typeof this._control.userAriaDescribedBy === 'string') {
512511
ids.push(...this._control.userAriaDescribedBy.split(' '));
513512
}
514513

0 commit comments

Comments
 (0)