Accessibility fix for JAWS screen readers

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'.
pull/5149/head
Volker Bijewitz 2021-08-11 09:03:04 +02:00 committed by Richard Hansen
parent 15995acc2a
commit 84d6d277d7
2 changed files with 2 additions and 1 deletions

View File

@ -284,7 +284,6 @@ const Ace2Editor = function () {
// <body> tag
innerDocument.body.id = 'innerdocbody';
innerDocument.body.classList.add('innerdocbody');
innerDocument.body.setAttribute('role', 'application');
innerDocument.body.setAttribute('spellcheck', 'false');
innerDocument.body.appendChild(innerDocument.createTextNode('\u00A0')); // &nbsp;

View File

@ -61,6 +61,8 @@ domline.createDomLine = (nonEmpty, doesWrap, optBrowser, optDocument) => {
if (document) {
result.node = document.createElement('div');
// JAWS and NVDA screen reader compatibility. Only needed if in a real browser.
result.node.setAttribute('aria-live', 'assertive');
} else {
result.node = {
innerHTML: '',