-
Notifications
You must be signed in to change notification settings - Fork 42
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
Link focusable static math textarea with mathspeak region through ARIA #311
Link focusable static math textarea with mathspeak region through ARIA #311
Conversation
We were setting the aria-label attribute of focusable static math textareas to an empty string, which might explain some issues observed in JAWS. THis approach uses aria-labelledby to connect the textarea to the offscreen mathspeak span for focusable static math which appears to resolve the problem.
const r = (Math.random() * 16) | 0; | ||
const v = c === 'x' ? r : (r & 0x3) | 0x8; | ||
return v.toString(16); | ||
}); |
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.
I don't feel particularly confident with the right approaches to forming a uuid. I wonder about the alternative instead where there's some global value that increments. Would love someone else to review this part! Test looks great and the behavior makes sense.
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.
Will do. I chose to write this inline rather than add another build dependency. Using the internal id won't work, though, in the case where multiple MQ instances might be set up on the same page.
textarea[0].getAttribute('aria-labelledby'), | ||
mathspeakId, | ||
'textarea is aria-labelledby mathspeak region' | ||
); |
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.
beautiful test
If we need a page-globally-unique ID, then UUID does sound like the way to go, rather than a globally incrementing ID since we can't guarantee that the MQ instance is the only one on the page. Why is this needed on focusable static math but not on editable math? They should have the same textarea setup. |
@jared-hughes I think this is ready now. Care to give it another pass? |
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!
This PR makes two subtle changes to focusable static math: