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

Consider use of innerHTML in ariaHerald #441

Closed
mbarlow12 opened this issue Dec 17, 2018 · 7 comments
Closed

Consider use of innerHTML in ariaHerald #441

mbarlow12 opened this issue Dec 17, 2018 · 7 comments
Assignees

Comments

@mbarlow12
Copy link
Contributor

From phetsims/gravity-force-lab#131.

We're currently setting the textContent of the aria-live elements which strips HTML Entities (e.g. ×) instead of rendering them.

It may be more pertinent to simply spell out such cases, but we could also consider adding a flag to the config object that indicates the inclusion of HTML in the alert.

@jessegreenberg
Copy link
Contributor

I think this is a good idea, could we handle this like we handle setting inner content for accessible content in the PDOM? What if ariaHerald.updateLiveElement were changed to use AccessibilityUtil.setTextContent?

@mbarlow12 mbarlow12 changed the title Cosider use of innerHTML in ariaHerald Consider use of innerHTML in ariaHerald Dec 17, 2018
@jessegreenberg
Copy link
Contributor

I committed this and it seems OK with NVDA. @mbarlow12 can you please review and test if this fixes things in VO?

@jessegreenberg jessegreenberg removed their assignment Dec 17, 2018
@mbarlow12
Copy link
Contributor Author

Thanks @jessegreenberg. My only hesitation would be whether we want to fully support all HTML features in our alerts. The most significant use case I can think of would be for MathML, which may be a valid consideration as we move onto a11y tooling in more math-heavy sims.

Can you think of a situation where it would be useful to include generic HTML in an aria-live element?

@mbarlow12
Copy link
Contributor Author

Results are mixed. The entity is now correctly rendered, but VO appears to contextually read "multiplication" or "times" depending on some unknown parameters. aria-live elements are read as "multiplication" while PDOM list items appear as "times". Very odd.

@jessegreenberg
Copy link
Contributor

OK understood, thanks for testing. In that case we may have to go back to passing in "times" as a full string. We do not have control over how VO interprets the context unfortunately.

@mbarlow12
Copy link
Contributor Author

@jessegreenberg I'll do a little testing/digging this week to see if there might be a way for us to tweak what VO reads.

@jessegreenberg
Copy link
Contributor

Closing this issue for now, we will work on this naturally when we require more complicated entities in alerts.

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

No branches or pull requests

2 participants