File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,6 @@ export class MatChipListChange {
78
78
exportAs : 'matChipList' ,
79
79
host : {
80
80
'[attr.tabindex]' : 'disabled ? null : _tabIndex' ,
81
- '[attr.aria-describedby]' : '_ariaDescribedby || null' ,
82
81
'[attr.aria-required]' : 'role ? required : null' ,
83
82
'[attr.aria-disabled]' : 'disabled.toString()' ,
84
83
'[attr.aria-invalid]' : 'errorState' ,
@@ -144,9 +143,6 @@ export class MatChipList
144
143
/** Uid of the chip list */
145
144
_uid : string = `mat-chip-list-${ nextUniqueId ++ } ` ;
146
145
147
- /** The aria-describedby attribute on the chip list for improved a11y. */
148
- _ariaDescribedby : string ;
149
-
150
146
/** Tab index for the chip list. */
151
147
_tabIndex = 0 ;
152
148
@@ -455,7 +451,11 @@ export class MatChipList
455
451
* @docs -private
456
452
*/
457
453
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
+ }
459
459
}
460
460
461
461
// Implemented as part of ControlValueAccessor.
You can’t perform that action at this time.
0 commit comments