Skip to content

Commit

Permalink
Prevent line numbers from being voiced by screen readers
Browse files Browse the repository at this point in the history
Sets aria-hidden=true on .CodeMirror-gutter-wrapper elements

Fixes #6578
  • Loading branch information
aomarks authored and marijnh committed Apr 12, 2021
1 parent 770433e commit 2997167
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/display/update_line.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2997167

Please sign in to comment.