Skip to content

Accessibility fix for JAWS screen readers#5149

Merged
rhansen merged 1 commit intoether:developfrom
vwbij:jaws_screenreader_fixes
Aug 12, 2021
Merged

Accessibility fix for JAWS screen readers#5149
rhansen merged 1 commit intoether:developfrom
vwbij:jaws_screenreader_fixes

Conversation

@vwbij
Copy link
Copy Markdown
Contributor

@vwbij vwbij commented Aug 11, 2021

ace.js: removed the role 'application' from innerDocument.body. JAWS do not read any text from the edit lines if this role is set.

domline.createDomLine: to give JAWS the ability to read the lines correctly, it is required to set the attribute 'aria-live' to 'assertive'.

Copy link
Copy Markdown
Member

@rhansen rhansen left a comment

Choose a reason for hiding this comment

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

Thank you!

I pushed some minor fixes to your branch. If they look OK to you I'll squash them into your commit when I merge.

Comment thread src/static/js/domline.js Outdated

if (document) {
result.node = document.createElement('div');
// Set the ARIA role and label for JAWS compatibility. Do it here, because it is only needed and
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This comment says "Set the ARIA role" but I don't see role set anywhere. Is that intentional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The comment points to the attribute 'aria-live'='assertive', you are right, it has nothing to do with the role. So the comment is not well-formed and may be changed to better understanding.

Comment thread src/static/js/domline.js
result.node = document.createElement('div');
// Set the ARIA role and label for JAWS compatibility. Do it here, because it is only needed and
// possible if we have a document and are working in a real browser context.
result.node.setAttribute('aria-live', 'assertive');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just to confirm: Is assertive the right value here? I'm not an ARIA expert, which is why I'm a bit concerned by MDN's strong language:

aria-live="assertive" should only be used for time-sensitive/critical notifications that absolutely require the user's immediate attention.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is the right value we choose, we tested it and found it as a required value to make JAWS and NVDA work correctly. Before we checked "role=textbox" and "ariaLabel=Line". It was working also, but testing it in the school environment turned out that "assertive" is the best choice.
I am also not a expert in ARIA, it was just checking what makes the screenreader work correctly, and this depends on how the screenreader deals with that values.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The changes you have committed above are OK, thank you! So it is good to let them flow into the merge as you are ready to do it.

ace.js: removed the role 'application' from innerDocument.body. JAWS
do not read any text from the edit lines if this role is set.

domline.createDomLine: to give JAWS the ability to read the lines
correctly, it is required to set the attribute 'aria-live' to
'assertive'.
@rhansen rhansen force-pushed the jaws_screenreader_fixes branch from 7e276d7 to 84d6d27 Compare August 12, 2021 17:48
@rhansen rhansen merged commit 84d6d27 into ether:develop Aug 12, 2021
@vwbij
Copy link
Copy Markdown
Contributor Author

vwbij commented Aug 12, 2021

Thank you, have a nice evening!

@vwbij vwbij deleted the jaws_screenreader_fixes branch August 12, 2021 18:07
JohnMcLear added a commit to JohnMcLear/etherpad that referenced this pull request Apr 4, 2026
Three accessibility fixes:

ether#6581 (WCAG 2.1.2 keyboard trap): Escape key now moves focus from the
editor to the first toolbar button, giving keyboard-only users an
escape route. Added a screen-reader-only hint about Escape and Alt+F9.

ether#7255 (screen reader access): Added role="textbox", aria-multiline="true",
and aria-label="Pad content" to the contenteditable body so screen
readers can identify and interact with the editor content. Fixed
non-standard aria-role="document" to role="document" in pad.html.

ether#5695 (aria-live character echo): Removed aria-live="assertive" from
every line div in domline.ts. This was causing screen readers to
announce every character typed, overriding users' keyboard echo
settings. The attribute was added in PR ether#5149 for JAWS compatibility
but aria-live on individual contenteditable lines is a misuse.

Also added .sr-only CSS utility class for visually hidden content.

Fixes ether#6581, ether#7255, ether#5695

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
JohnMcLear added a commit to JohnMcLear/etherpad that referenced this pull request Apr 5, 2026
Three accessibility fixes:

ether#6581 (WCAG 2.1.2 keyboard trap): Escape key now moves focus from the
editor to the first toolbar button, giving keyboard-only users an
escape route. Added a screen-reader-only hint about Escape and Alt+F9.

ether#7255 (screen reader access): Added role="textbox", aria-multiline="true",
and aria-label="Pad content" to the contenteditable body so screen
readers can identify and interact with the editor content. Fixed
non-standard aria-role="document" to role="document" in pad.html.

ether#5695 (aria-live character echo): Removed aria-live="assertive" from
every line div in domline.ts. This was causing screen readers to
announce every character typed, overriding users' keyboard echo
settings. The attribute was added in PR ether#5149 for JAWS compatibility
but aria-live on individual contenteditable lines is a misuse.

Also added .sr-only CSS utility class for visually hidden content.

Fixes ether#6581, ether#7255, ether#5695

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
JohnMcLear added a commit that referenced this pull request Apr 5, 2026
…7451)

* fix: accessibility — keyboard trap, screen reader support, aria-live

Three accessibility fixes:

#6581 (WCAG 2.1.2 keyboard trap): Escape key now moves focus from the
editor to the first toolbar button, giving keyboard-only users an
escape route. Added a screen-reader-only hint about Escape and Alt+F9.

#7255 (screen reader access): Added role="textbox", aria-multiline="true",
and aria-label="Pad content" to the contenteditable body so screen
readers can identify and interact with the editor content. Fixed
non-standard aria-role="document" to role="document" in pad.html.

#5695 (aria-live character echo): Removed aria-live="assertive" from
every line div in domline.ts. This was causing screen readers to
announce every character typed, overriding users' keyboard echo
settings. The attribute was added in PR #5149 for JAWS compatibility
but aria-live on individual contenteditable lines is a misuse.

Also added .sr-only CSS utility class for visually hidden content.

Fixes #6581, #7255, #5695

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: Escape closes gritters first, only exits editor if nothing to dismiss

If gritter popups are visible, Escape closes them and keeps focus in
the editor. Only when there are no popups does Escape move focus to
the toolbar for keyboard trap escape.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address Qodo review — keyboard hint in iframe, aria-readonly

- Move keyboard hint (Escape/Alt+F9) inside the inner iframe with
  aria-describedby so screen readers announce it when focusing the
  editor. Previously it was on the outer editorcontainer which is a
  different document context.
- Set aria-readonly on the editor body when in readonly mode so screen
  readers correctly convey editability state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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