Skip to content

Commit 0d6ed05

Browse files
build(chips) Update MDC version to add new chip adapter method
1 parent dcde115 commit 0d6ed05

File tree

4 files changed

+456
-455
lines changed

4 files changed

+456
-455
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"@angular/platform-browser": "^8.1.0",
4848
"@webcomponents/custom-elements": "^1.1.0",
4949
"core-js": "^2.6.1",
50-
"material-components-web": "^2.3.1",
50+
"material-components-web": "^3.0.0",
5151
"rxjs": "^6.4.0",
5252
"systemjs": "0.19.43",
5353
"tsickle": "^0.35.0",

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,15 @@ export class MatChip extends _MatChipMixinBase implements AfterContentInit, Afte
260260
// so they will never be called
261261
getRootBoundingClientRect: () => this._elementRef.nativeElement.getBoundingClientRect(),
262262
getCheckmarkBoundingClientRect: () => { return null; },
263+
setAttr: (attr, value) => {
264+
// MDC is currently using this method to set aria-checked on choice and filter chips,
265+
// which in the MDC templates have role="checkbox" and role="radio" respectively.
266+
// We have role="option" on those chips instead; as such, we do not want aria-checked.
267+
if (attr === 'aria-checked') {
268+
return;
269+
}
270+
this._elementRef.nativeElement.setAttribute(attr, value);
271+
},
263272
};
264273

265274
constructor(

src/material-experimental/mdc-helpers/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ sass_library(
116116
"@npm//:node_modules/@material/theme/_functions.scss",
117117
"@npm//:node_modules/@material/theme/_mixins.scss",
118118
"@npm//:node_modules/@material/theme/_variables.scss",
119-
"@npm//:node_modules/@material/toolbar/_mixins.scss",
120-
"@npm//:node_modules/@material/toolbar/_variables.scss",
121119
"@npm//:node_modules/@material/top-app-bar/_mixins.scss",
122120
"@npm//:node_modules/@material/top-app-bar/_variables.scss",
123121
"@npm//:node_modules/@material/typography/_functions.scss",

0 commit comments

Comments
 (0)