From f9ebb262a30043589d8863a724b31907e92fe538 Mon Sep 17 00:00:00 2001 From: Vanessa Schmitt Date: Tue, 16 Jul 2019 10:31:24 -0700 Subject: [PATCH] fix(mdc chips) Don't let MDC set aria-checked attribute on option chips (#16530) --- src/material-experimental/mdc-chips/chip.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/material-experimental/mdc-chips/chip.ts b/src/material-experimental/mdc-chips/chip.ts index 96cb7bd692d..67d675aa739 100644 --- a/src/material-experimental/mdc-chips/chip.ts +++ b/src/material-experimental/mdc-chips/chip.ts @@ -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,