Skip to content
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

More mathspeak and ARIA clean-up #312

Merged
merged 3 commits into from
Oct 29, 2024

Conversation

sclower
Copy link

@sclower sclower commented Oct 28, 2024

First, adds the aria-hidden attribute to any focusable mQ's mathspeak region so that screen readers don't double-report the content, e.g. when the field is used as a table column header.

Second, empties the content of the math field's internal ARIA alert element when the field loses focus. Helps with the first problem above, but is something we should have been doing anyway.

First, adds the aria-hidden attribute to any focusable mQ's mathspeak region so that screen readers don't double-report the content, e.g. when the field is used as a column header.

Second, empties the content of the math field's internal ARIA alert element when the field loses focus. Helps with the first problem above, but is something we should have been doing anyway.
@sclower sclower requested review from a team and jared-hughes and removed request for a team October 28, 2024 17:50
@@ -93,8 +93,9 @@ class Aria {
return this.clear();
}

clear() {
clear(opts?: { emptyContent: boolean }) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would help to have some documentation here (and on updateMathspeak) about when a consumer would pass in emptyContent: true or not. Judging by the PR message, it sounds like we want to pass in emptyContent: true when the clear is due to a blur.

Why do we not want to pass emptyContent: true for non-blur clearing?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jared-hughes I've added some comments in both source files to hopefully clarify the intent of the clearContent flag.

There are two reasons why we empty the alert queue but leave the DOM in tact. The first is literally because any queued messages may no longer be relevant. The second is that, while the field has focus, we want to minimize the amount of updates to the alert element to reduce the chance that something important might not be communicated to the user. Admittedly, I haven't seen this latter case in years, but it's been known to happen.

@sclower sclower merged commit 40f5efc into main Oct 29, 2024
3 checks passed
@sclower sclower deleted the sclower/clear-aria.message-span-on-blur branch October 29, 2024 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants