Skip to content

Commit c10a150

Browse files
committed
fix
1 parent 5e0dfc1 commit c10a150

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/material/chips/chip-grid.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,9 @@ export class MatChipGrid
305305
registerInput(inputElement: MatChipTextControl): void {
306306
this._chipInput = inputElement;
307307
this._chipInput.setDescribedByIds(this._ariaDescribedbyIds);
308+
309+
// If ids were already attached to host element, can now remove in favor of chipInput
310+
this._elementRef.nativeElement.removeAttribute('aria-describedby');
308311
}
309312

310313
/**
@@ -364,6 +367,8 @@ export class MatChipGrid
364367
* @docs-private
365368
*/
366369
setDescribedByIds(ids: string[]) {
370+
// We must keep this up to date to handle the case where ids are set
371+
// before the chip input is registered.
367372
this._ariaDescribedbyIds = ids;
368373

369374
if (this._chipInput) {

0 commit comments

Comments
 (0)