From 2997167571787db3da8a15e5ac65c8ddaf316f0a Mon Sep 17 00:00:00 2001 From: Alexander Marks Date: Sun, 11 Apr 2021 10:48:17 -0700 Subject: [PATCH] Prevent line numbers from being voiced by screen readers Sets aria-hidden=true on .CodeMirror-gutter-wrapper elements Fixes #6578 --- src/display/update_line.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/display/update_line.js b/src/display/update_line.js index 50d781ee84..dd1aac8b03 100644 --- a/src/display/update_line.js +++ b/src/display/update_line.js @@ -104,6 +104,7 @@ function updateLineGutter(cm, lineView, lineN, dims) { if (cm.options.lineNumbers || markers) { let wrap = ensureLineWrapped(lineView) let gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", `left: ${cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth}px`) + gutterWrap.setAttribute("aria-hidden", "true") cm.display.input.setUneditable(gutterWrap) wrap.insertBefore(gutterWrap, lineView.text) if (lineView.line.gutterClass)