Skip to content

Commit

Permalink
[SR][SR Tree] Show the descriptions again (#2096)
Browse files Browse the repository at this point in the history
## Summary:
By changing the text getting to `innerText` insted of
`textContent`, we actually stopped displaying the
descriptions.

Go back to using `textContent` so the descriptions
display again.

Issue: none

## Test plan:
Storybook
- http://localhost:6006/?path=/story/perseuseditor-widgets-interactive-graph--interactive-graph-linear
- check that the screen reader tree shows all the
  linear graph descriptions

| Before | After |
| --- | --- |
| ![Screenshot 2025-01-13 at 10 12 52 AM](https://github.com/user-attachments/assets/5d6f9ce7-f692-4225-bb94-e748db867f2e) | ![Screenshot 2025-01-13 at 10 16 24 AM](https://github.com/user-attachments/assets/80528e07-84fb-4262-bcfb-936f21deb501) |

Author: nishasy

Reviewers: benchristel

Required Reviewers:

Approved By: benchristel

Checks: ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ⏹️  [cancelled] Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x)

Pull Request URL: #2096
  • Loading branch information
nishasy authored Jan 13, 2025
1 parent 5173c2e commit a3c7b64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/cool-shrimps-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/perseus-editor": patch
---

[SR][sr tree] Show descriptions again
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function getAccessibilityAttributes(
const descriptions = ariaDescribedby.split(/ +/);
for (const description of descriptions) {
const descriptionString =
document.getElementById(description)?.innerText;
document.getElementById(description)?.textContent;

if (descriptionString) {
elementAttributes.push({
Expand Down

0 comments on commit a3c7b64

Please sign in to comment.