-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use aria-hidden to hide icons from screen readers
Instead of the presentation role. After upgrading axe-core, we're now getting failures for presentation not being a valid role for <svg> elements. I'm not 100% sure that's the case. But we can see that axe-core has an allowlist for what elements can have that role [1], and svg is not on it. There doesn't seem to be documentation anywhere that it's explicitly not allowed. But this change has the same effect, and plays nicely with axe. Also, MDN lists some interesting differences between role="presentation" and aria-hidden [2]. aria-hidden is for literally hiding something from assistive technology, while role="presentation" only strips an element of any semantics. Hiding it in this case seems reasonable and what we actually intend. 1. https://github.com/dequelabs/axe-core/blob/2777dbc20c028d88a906e49a3c d7032b482f0988/lib/commons/aria/index.js#L1462-L1488 2. https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_ Techniques/Using_the_aria-hidden_attribute
- Loading branch information
Showing
5 changed files
with
37 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters