Skip to content

SVG icons: restore attributes required for accessibility #9269

@afercia

Description

@afercia

#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.

Metadata

Metadata

Assignees

Labels

[Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).[Type] BugAn existing feature does not function as intended[Type] RegressionRelated to a regression in the latest release

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions