From 84d6d277d73744d3cea2962d2aa81154b9313684 Mon Sep 17 00:00:00 2001 From: Volker Bijewitz Date: Wed, 11 Aug 2021 09:03:04 +0200 Subject: [PATCH] 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'. --- src/static/js/ace.js | 1 - src/static/js/domline.js | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/static/js/ace.js b/src/static/js/ace.js index 1e73ac48f..9339e46fd 100644 --- a/src/static/js/ace.js +++ b/src/static/js/ace.js @@ -284,7 +284,6 @@ const Ace2Editor = function () { // 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')); //   diff --git a/src/static/js/domline.js b/src/static/js/domline.js index 032a8d083..af786b2dc 100644 --- a/src/static/js/domline.js +++ b/src/static/js/domline.js @@ -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: '',