Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG icons: restore attributes required for accessibility #9269

Closed
afercia opened this issue Aug 23, 2018 · 3 comments · Fixed by #9299
Closed

SVG icons: restore attributes required for accessibility #9269

afercia opened this issue Aug 23, 2018 · 3 comments · Fixed by #9299
Assignees
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release

Comments

@afercia
Copy link
Contributor

afercia commented Aug 23, 2018

#8916 changed many SVG icons, hardcoding them instead of using the Dashicon component. Thus, all the new icons now miss a few HTML attributes that are required for accessibility:

  • role="img" aria-hidden="true" to ensure they're hidden from assistive technologies
  • focusable="false" to work around an IE 11 bug where all the SVG icons within focusable elements are considered by IE focusable themselves, so there's the need to press the Tab key twice when navigating using the keyboard

I'm not sure what are the plans for all these hardcoded SVG icons. For sure, using the Dashicon component was ideal to standardize all the default props and rendered HTML attributes. If these new icons are going to stay hardcoded across the codebase (which I see less ideal), then there's the need to add to all of them the missing attributes.

@afercia afercia added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Regression Related to a regression in the latest release labels Aug 23, 2018
@aduth
Copy link
Member

aduth commented Aug 23, 2018

For icons which we expect to be developer-provided (e.g. block icons), should we anticipate that they could forget these attributes† and try to correct them programmatically?

† Painfully obvious given the "Regression" label 😉

@afercia
Copy link
Contributor Author

afercia commented Aug 23, 2018

Of course it would be great to make sure these attributes are present also in icons provided by plugins 🙂

jasmussen pushed a commit that referenced this issue Aug 24, 2018
This fixes #9269.

It adds back to the SVGs `role="img" aria-hidden="true" focusable="false"` properties that went missing as part of the block library iteration.
@jasmussen
Copy link
Contributor

Fixed it in PR linked above.

Though worth noting this doesn't fix it for all plugin blocks in the future. Is the solution documentation, or JS wizardry? For now though, I'd think that would be a separate (though worthwhile) consideration from this ticket.

jasmussen added a commit that referenced this issue Aug 27, 2018
This fixes #9269.

It adds back to the SVGs `role="img" aria-hidden="true" focusable="false"` properties that went missing as part of the block library iteration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants