-
Notifications
You must be signed in to change notification settings - Fork 351
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
[SR] Add aria-hidden to individual components of interactive graph elements #2277
Conversation
…f interactive graph elements
Size Change: +313 B (+0.04%) Total Size: 873 kB
ℹ️ View Unchanged
|
…al components of interactive graph elements
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (68eb743) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR2277 If you are working in Khan Academy's webapp, you can run: ./dev/tools/bump_perseus_version.sh -t PR2277 |
Does this have any adverse effects on other screen readers? I know this is pretty bad on Safari, but I want to make sure we're not over correcting for issues that should be logged against Safari/VoiceOver. |
@catandthemachines This doesn't affect the experience in any other browsers, it just corrects the issue in Safari. The other browsers didn't read out those elements in the first place, so this is just the status quo for those. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks for this great fix. :)
Note: I tried testing what I currently have in storybook and I wasn't able to recreate it with Safari. 🤔 I wonder if this is a more recent bug that they've introduced, as I'm a few versions behind.
y={y} | ||
color={color.blue} | ||
svgPathProps={{ | ||
// Use aria-hidden to hide the line from screen readers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooo fun I never looked into this but I'm glad mafs allowed us to pass props through.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No impact to other screen readers, lets go! 😎
Update: Third was able to repro when using control + option + arrow keys. |
Summary:
When using Safari + VoiceOver, the screen reader reads out every single internal part of every single element on the graph. For example, the arrow on a line is read out as "image" as well as the segment composing the line. This means that when traversing the graph in Safari, there are a whole bunch of empty "image"s being read out with no context. The context is provided by specific element's aria labels.
To remedy this, I added
aria-hidden
to all the visual elements that should not be read as "image" in all the graph types.Issue: none
Test Plan:
Storybook