Skip to content

Commit 657f0e8

Browse files
jelbournandrewseguin
authored andcommitted
fix(icon): remove automatic aria labelling and add a11y guidance (#4665)
The automatic application of aria-label for md-icon, in hindsight, was not a great idea. Neither the ligature string nor the SVG filename are likely to be meaningful descriptions. Even in cases where they *are*, the icon may be used in such a way that the application of a label is still the wrong thing. On top of that, adding `role="img"` is usually not the right approach for an icon, as that role typically refers to *content* images, rather than icons that are part of the UI. Ultimately, it is up to the application developer to add the appropriate meaning for icons based on how they're used. To this end, we add guidance to the documentation for what to do in different situations.
1 parent 536add3 commit 657f0e8

File tree

6 files changed

+529
-773
lines changed

6 files changed

+529
-773
lines changed

e2e/components/icon/icon.e2e.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ describe('icon', () => {
1111
testIcon = element(by.id('test-icon'));
1212
});
1313

14-
it('should have the correct aria-label when used', () => {
15-
expect(testIcon.getAttribute('aria-label')).toBe('favorite');
16-
screenshot();
17-
});
18-
1914
it('should have the correct class when used', async () => {
2015
const attr = await testIcon.getAttribute('class');
2116

0 commit comments

Comments
 (0)