Problem/Motivation
CKEditor5 text area doesn't have appropriate aria-label for screen reader
Steps to reproduce
- activate screen reader
- tab to text area with CKEditor5 component (for example label on the field is "Description")
- screen reader reads out "Editor editing area: main, edit text ...."
Screenshot:

Expected behavior:
- screen reader should read out the label of the field "Description, edit text ...."
Here's an example of screen reader text for a regular text area:

Proposed resolution
assign field label to aria-label on CKEditor5 component
Remaining tasks
- patch
- tests
User interface changes
- none
API changes
- none
Data model changes
- none
Release notes snippet
- TBA
NOTE: CKEditor 5 has an issue for it on github (https://github.com/ckeditor/ckeditor5/issues/15208)
| Comment | File | Size | Author |
|---|---|---|---|
| #29 | Screenshot 2025-09-16 at 12.52.59 PM.png | 103.9 KB | itmaybejj |
| #22 | Screenshot 2024-03-25 at 16.56.37.png | 37.92 KB | simohell |
| #22 | Screenshot 2024-03-25 at 16.48.10.png | 46.99 KB | simohell |
| #15 | 3426798-nr-bot.txt | 90 bytes | needs-review-queue-bot |
| #12 | 3426798-nr-bot.txt | 90 bytes | needs-review-queue-bot |
Issue fork drupal-3426798
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
jannakha commentedpatch in - MR !6983

after patch is applied screen reader reads out a proper field name:
Comment #4
smustgrave commentedHave not tested but bugs will need a failing test assertion to show the issue.
Comment #5
wim leersThe JS changes look very sensible and simple — that's a great start! 😄👍
Interestingly, this made one Functional JavaScript test fail:
🤔
Comment #6
jannakha commentedComment #7
mgiffordI'm just looking at the source here.
This sounds like an upstream bug. Shouldn't CKEditor just do this:
Not that we can't too, but surely, if there is a label in the text area, CKEditor should respect that, right? Or am I missing something?
Comment #8
wim leersGood question. We should identify whether it's an upstream bug and report it upstream if it hasn't been already.
If it is an upstream bug, we should still work around it to help hundreds of thousands of Drupal 9/10 users. But we should add a
@todoon our end to ensure we remove the work-around when it is fixed upstream.Comment #9
jannakha commentedto #7
yes, there's issue for that https://github.com/ckeditor/ckeditor5/issues/15208
no, CKEditor doesn't respect that label (CKEditor is not even aware of the label):
there's a element rendered by CKEditor which has "Reach Text Editor" value, but it's not being read out by screen reader as it's label for a div (even if it has a role=application)

The label which is being read out is on the textbox itself:
in my case, I've got a dozen of CKEditors fields which all are reading out as "Editor editing area: main" - which fails accessibility testing.
this patch is a temporary measure until CKEditor5 fixed #15208, and then we'll need to pass the value of the label to CKEditor5 at initialisation
Comment #10
wim leersPerfect! Thanks for that research! 🙏👍
So let's fix it here with a
// @todo …as I mentioned :)Comment #11
jannakha commented- fixed/tested this feature on off-canvas and modal dialog modes
- added tests
Comment #12
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #13
jannakha commentedI don't know what "needs-review-queue-bot" means
I think I just wasted 3 days on my life on this
it's too hard basket, I'm going bowling.
Comment #14
jannakha commentedComment #15
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #16
jannakha commentedComment #21
jannakha commentedMR !7170
how to test:
on standard installation:
- create new content -> add new article
- CKEditor 5 field should have a "Body ..." text in aria-label and
Comment #22
simohell commentedI was very happy to see this issue posted as this has come up in our testing as well and was planning to create this issue myself.
I tested that latest MR indeed fixes the label issue (with VoiceOver) but I noted that there seems to be also one degradation. It seems that the info about CKEditor accessibility instructions have dropped away. In our accessibility testing we considered that piece information (alt-0 / option-0 for help) to be important for the user.
I think we should keep that piece of information announced as well.
Without the patch:

With the patch:

(I was testing with several different types of fields - named Body, Corpse, Cadaver and Carcass. Corpse-field was formatted long text without summary.)
This issue is somewhat related to #1562776: Edit Summary label is unclear to users as the summary/main text labelling is a special case of the problem.
Comment #23
jannakha commented@simohell
what's your configuration of CKEditor or which version of CKEditor 5 you have installed? :
- how is "Press Option 0" help text added? is that a special config? or special module?
the reason I'm asking is that I didn't have that text in my default installation/configuration of CKEditor 5 on Drupal 10 (as you can see in the issue description screenshot - the voiceover text doesn't include keyboard shortcut text).
Maybe temporary solution can be just replacing "Editor editing area: main" with the field label? Looks like "Editor editing area: main" is a constant for simple editor.
*temporary until https://github.com/ckeditor/ckeditor5/issues/15208 is resolved (if you can +1 this issue maybe CKSource will fix it sooner?)
Comment #24
simohell commentedSorry for having to wait for a reply.
I just had the at that moment latest 11.x dev branch of core, nothing else.
And the other one was the this issues branch.
Comment #25
jannakha commentedI guess I had an old version of Drupal, now I have help text too.
Comment #26
jannakha commentedCKEditor5 have resolved the original issue (configurable labels of editors):
- https://github.com/ckeditor/ckeditor5/issues/15208
Once the new version of CKEditor5 (v42.0.3?) is released with Drupal:
- update label of the editor as per example
Comment #27
rkolleri've tried to apply MR7170 but i somehow run into an assertion error when i try to run drush cr after switching to that issue fork. since that error happens consistently (spun up a new instance where i ran into the exact same error) is it possible that the MR might need a rebase? not sure if that would fix it, but the last commit was four months ago, and the assertion error i get ( a non e existent navigation.info.yaml ) is totally unrelated to the changes in the MR.
Comment #28
smustgrave commentedQuestion will this fix an issue where if the text field is required the aria-label isn't announcing?
Comment #29
itmaybejj commentedCan I suggest an approach that addresses both the concerns about required and the help text, and avoids fighting with CKEditor over the aria-label?
Rather than adding an aria-label to the CKEditor frame, add it to the field wrapper, with another attribute of role="group":
<div class="form-item" role="group" aria-label="[original field label] [, required (if applicable)]"...eg
<div class="form-item" role="group" aria-label="Body, Required"...Then the screen reader will speak the various inner labels (there may be several: Summary, Text Area, etc), but you would hear the field label itself and whether the fieldset is required when the cursor enters the region.
Technically this converts the field label into a legend, but seeing as CKEditor is labelling an application...having both labels might make a lot of sense.
...although ideally the required attribute WOULD go on the textarea itself and not the outer group, since it is not the group that is required. So maybe the event listener code in the MR would still be needed to sync the required attribute, if CKEditor is messing with that too.
Comment #31
timohuismanI agree with #22, it is helpful to keep the alt-0 / option-0 for help information in the aria-label. I updated the existing merge request so that the field label is placed before the aria label instead of overwriting the value.
Attached is a snapshot of the MR so it can be safely used with composer patches.
#26 still needs to be addressed.
Comment #32
mgifford