File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,6 @@ export class MatChipListChange {
7878 exportAs : 'matChipList' ,
7979 host : {
8080 '[attr.tabindex]' : 'disabled ? null : _tabIndex' ,
81- '[attr.aria-describedby]' : '_ariaDescribedby || null' ,
8281 '[attr.aria-required]' : 'role ? required : null' ,
8382 '[attr.aria-disabled]' : 'disabled.toString()' ,
8483 '[attr.aria-invalid]' : 'errorState' ,
@@ -144,9 +143,6 @@ export class MatChipList
144143 /** Uid of the chip list */
145144 _uid : string = `mat-chip-list-${ nextUniqueId ++ } ` ;
146145
147- /** The aria-describedby attribute on the chip list for improved a11y. */
148- _ariaDescribedby : string ;
149-
150146 /** Tab index for the chip list. */
151147 _tabIndex = 0 ;
152148
@@ -455,7 +451,11 @@ export class MatChipList
455451 * @docs -private
456452 */
457453 setDescribedByIds ( ids : string [ ] ) {
458- this . _ariaDescribedby = ids . join ( ' ' ) ;
454+ if ( ids . length ) {
455+ this . _elementRef . nativeElement . setAttribute ( 'aria-describedby' , ids . join ( ' ' ) ) ;
456+ } else {
457+ this . _elementRef . nativeElement . removeAttribute ( 'aria-describedby' ) ;
458+ }
459459 }
460460
461461 // Implemented as part of ControlValueAccessor.
You can’t perform that action at this time.
0 commit comments