User tests: Successful: Unsuccessful:
Pull Request resolves #48153.
This PR was drafted with AI assistance (Claude). I reviewed, tested (see below), and am accountable for the change per the Generative AI policy.
plg_editors_codemirror replaces the field's <textarea> with a CodeMirror 6 contenteditable (role="textbox"), but never gives that element an accessible name. The original <label for="..."> still points at the now-hidden textarea, so screen reader users land in the editor with no indication of which field they're editing (axe-core: aria-input-field-name, WCAG 4.1.2, serious).
createFromTextarea() in build/media_source/plg_editors_codemirror/js/codemirror.es6.js now looks up the textarea's associated <label> and passes it through via CodeMirror's EditorView.contentAttributes facet:
aria-labelledby when the label has an id (Joomla's joomla.form.renderlabel layout always gives the label an id of <fieldid>-lbl, so this is the path taken by core forms).aria-label (from the label's text) as a fallback when the label has no id.aria-label.Only the ES6 source is touched; media/plg_editors_codemirror/js/* is build output (gitignored) regenerated by the release build.
editor="codemirror" (or set CodeMirror as the default editor), e.g. Extensions → Templates → Templates → (edit a template file)..cm-content element and confirm it now carries aria-labelledby="<fieldid>-lbl" (or aria-label when no core label id is present).aria-input-field-name violation on .cm-content is gone.The CodeMirror editing surface has no accessible name; axe-core flags aria-input-field-name (serious, WCAG 4.1.2). Screen reader users hear "edit text" with no indication of which field they are in. Debug overlay shows no aria-labelledby/aria-label and a null computed accessible name:
The CodeMirror editing surface exposes the field's label as its accessible name via aria-labelledby/aria-label, matching what the <label for> on the plain <textarea> it replaces already provided. Debug overlay shows aria-labelledby="jform_articletext-lbl" resolving to the computed accessible name "Article Text":
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
🤖 Generated with Claude Code
| Status | New | ⇒ | Pending |
| Category | ⇒ | JavaScript Repository NPM Change |
| Title |
|
||||||