Skip to content

Commit dcc8442

Browse files
committed
fix(material/chips): add aria-hidden
add aria-hidden to host mat-chip so Talkback ignores element fixes b/286286473
1 parent 4d4b33b commit dcc8442

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/material/chips/chip-row.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ describe('MDC-based Row Chips', () => {
102102
});
103103

104104
it('should have the correct role', () => {
105-
expect(chipNativeElement.getAttribute('role')).toBe('presentation');
105+
expect(chipNativeElement.getAttribute('role')).toBe('row');
106106
});
107107

108108
it('should be able to set a custom role', () => {

src/material/chips/chip.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export interface MatChipEvent {
8787
'[attr.role]': 'role',
8888
'[attr.tabindex]': '_getTabIndex()',
8989
'[attr.aria-label]': 'ariaLabel',
90+
'[attr.aria-hidden]': 'true',
9091
'(keydown)': '_handleKeydown($event)',
9192
},
9293
encapsulation: ViewEncapsulation.None,
@@ -280,7 +281,6 @@ export class MatChip implements OnInit, AfterViewInit, AfterContentInit, DoCheck
280281
this._isBasicChip =
281282
element.hasAttribute(this.basicChipAttrName) ||
282283
element.tagName.toLowerCase() === this.basicChipAttrName;
283-
this.role = 'presentation';
284284
}
285285

286286
ngAfterViewInit() {

0 commit comments

Comments
 (0)