Skip to content

Commit f9ebb26

Browse files
vanessanschmittjelbourn
authored andcommitted
fix(mdc chips) Don't let MDC set aria-checked attribute on option chips (#16530)
1 parent 40ad0fc commit f9ebb26

File tree

1 file changed

+6
-0
lines changed
  • src/material-experimental/mdc-chips

1 file changed

+6
-0
lines changed

src/material-experimental/mdc-chips/chip.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,12 @@ export class MatChip extends _MatChipMixinBase implements AfterContentInit, Afte
257257
},
258258
hasLeadingIcon: () => { return !!this.leadingIcon; },
259259
setAttr: (name: string, value: string) => {
260+
// MDC is currently using this method to set aria-checked on choice and filter chips,
261+
// which in the MDC templates have role="checkbox" and role="radio" respectively.
262+
// We have role="option" on those chips instead, so we do not want aria-checked.
263+
if (name === 'aria-checked') {
264+
return;
265+
}
260266
this._elementRef.nativeElement.setAttribute(name, value);
261267
},
262268
// The 2 functions below are used by the MDC ripple, which we aren't using,

0 commit comments

Comments
 (0)