mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(mdc chips) Don't let MDC set aria-checked attribute on option chips (#16530)
This commit is contained in:
committed by
Jeremy Elbourn
parent
40ad0fcf76
commit
f9ebb262a3
@@ -257,6 +257,12 @@ export class MatChip extends _MatChipMixinBase implements AfterContentInit, Afte
|
||||
},
|
||||
hasLeadingIcon: () => { return !!this.leadingIcon; },
|
||||
setAttr: (name: string, value: string) => {
|
||||
// MDC is currently using this method to set aria-checked on choice and filter chips,
|
||||
// which in the MDC templates have role="checkbox" and role="radio" respectively.
|
||||
// We have role="option" on those chips instead, so we do not want aria-checked.
|
||||
if (name === 'aria-checked') {
|
||||
return;
|
||||
}
|
||||
this._elementRef.nativeElement.setAttribute(name, value);
|
||||
},
|
||||
// The 2 functions below are used by the MDC ripple, which we aren't using,
|
||||
|
||||
Reference in New Issue
Block a user