-
Notifications
You must be signed in to change notification settings - Fork 357
[SR] Add aria-hidden to individual components of interactive graph elements #2277
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
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. |
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @khanacademy/perseus@56.1.0 ### Minor Changes - [#2288](#2288) [`7ef0dae77`](7ef0dae) Thanks [@nishasy](https://github.com/nishasy)! - Mark Interactive Graph Widget as accessible. (Content authors are no longer blocked from checking/unchecking the "Requires screen or mouse?" checkbox.) ### Patch Changes - [#2291](#2291) [`e87914dcd`](e87914d) Thanks [@handeyeco](https://github.com/handeyeco)! - Update snapshots as a result of bumping Wonder Blocks - [#2283](#2283) [`0438f6331`](0438f63) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Bugfix to ensure that the Interactive Graph Editor updates the Polygon start coords if the number of sides change. - [#2287](#2287) [`9b4c1942e`](9b4c194) Thanks [@nishasy](https://github.com/nishasy)! - [LX] Make static graphs' interactive elements visually disabled - [#2282](#2282) [`5226f43a9`](5226f43) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Ensure that dragging a point also moves the focus for Interactive Graph - [#2281](#2281) [`015aace83`](015aace) Thanks [@catandthemachines](https://github.com/catandthemachines)! - Improving the angle snapping behavior for keyboard users in polygon examples. - [#2277](#2277) [`88e4e905d`](88e4e90) Thanks [@nishasy](https://github.com/nishasy)! - [SR] Hide individual visual components of interactive graph elements ## @khanacademy/perseus-editor@17.9.1 ### Patch Changes - Updated dependencies \[[`7ef0dae77`](7ef0dae), [`e87914dcd`](e87914d), [`0438f6331`](0438f63), [`9b4c1942e`](9b4c194), [`5226f43a9`](5226f43), [`015aace83`](015aace), [`88e4e905d`](88e4e90)]: - @khanacademy/perseus@56.1.0
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