-
Notifications
You must be signed in to change notification settings - Fork 350
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
[axes-aria-descriptions] [SR] Add aria-labels for x- and y-axis labels #2221
base: main
Are you sure you want to change the base?
Conversation
Right now if a person using a screen reader traverses through the graph, they hear "x, math" and "y, math" for the axis labels, or whatever the x and y labels are updated to by the content authors. We need to add a description for this so people know what x and y are referring to. - Added "X-axis" and "Y-axis" strings as `aria-label`s for the `AxisLabel` elements. - This means that it reads the actual label as a child of this axis label group - This is my preferred approach so that it already handles math speech wehen reading the TeX label, and we don't have to manually use the speech rule engine again redundantly Issue: https://khanacademy.atlassian.net/browse/LEMS-2844 Test plan: `yarn jest packages/perseus/src/widgets/interactive-graphs/mafs-graph.test.tsx` Storybook - Go to any interactive graph editor story (http://localhost:6006/iframe.html?globals=&args=&id=perseuseditor-widgets-interactive-graph--interactive-graph-segment&viewMode=story) - Use the screen reader to confirm that the axis labels now say "X-axis, group" - Continue using the screen reader and make sure that the actual axis label is read - Update the x and y labels to have some kind of math TeX like `\frac{1}{2}` - Repeat the above steps and confirm that the screen reader reads the math correctly
… and y-axis labels
@@ -17,6 +17,8 @@ import type {InteractiveGraphState} from "./types"; | |||
import type {GraphRange} from "@khanacademy/perseus-core"; | |||
import type {UserEvent} from "@testing-library/user-event"; | |||
|
|||
const baseMafsProps = getBaseMafsGraphPropsForTests(); |
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.
While I was in this file, I took this as an opportunity to reduce the number of function calls being made.
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (7e7e469) and published it to npm. You Example: yarn add @khanacademy/perseus@PR2221 If you are working in Khan Academy's webapp, you can run: ./dev/tools/bump_perseus_version.sh -t PR2221 |
Size Change: +61 B (0%) Total Size: 1.48 MB
ℹ️ View Unchanged
|
Summary:
Right now if a person using a screen reader traverses through the graph, they hear "x, math" and "y, math" for the axis labels, or whatever the x and y labels are updated to by the content authors.
We need to add a description for this so people know what x and y are referring to.
aria-label
s for theAxisLabel
elements.TeX label, and we don't have to manually use the speech rule engine again redundantly
Issue: https://khanacademy.atlassian.net/browse/LEMS-2844
Test plan:
yarn jest packages/perseus/src/widgets/interactive-graphs/mafs-graph.test.tsx
Storybook
\frac{1}{2}