Skip to content

Commit

Permalink
fix(icon): remove automatic aria labelling and add a11y guidance (#4665)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jelbourn authored and andrewseguin committed Jun 8, 2017
1 parent 536add3 commit 657f0e8
Show file tree
Hide file tree
Showing 6 changed files with 529 additions and 773 deletions.
5 changes: 0 additions & 5 deletions e2e/components/icon/icon.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ describe('icon', () => {
testIcon = element(by.id('test-icon'));
});

it('should have the correct aria-label when used', () => {
expect(testIcon.getAttribute('aria-label')).toBe('favorite');
screenshot();
});

it('should have the correct class when used', async () => {
const attr = await testIcon.getAttribute('class');

Expand Down
Loading

0 comments on commit 657f0e8

Please sign in to comment.