Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SR] Add aria-labels for x- and y-axis labels (#2221)
## 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. - 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 Author: nishasy Reviewers: nishasy, SonicScrewdriver, catandthemachines Required Reviewers: Approved By: SonicScrewdriver Checks: ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x) Pull Request URL: #2221
- Loading branch information