Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Editor title configurable again to fix accessibility issues #15208

Closed
jonbot opened this issue Oct 19, 2023 · 4 comments · Fixed by #16792
Closed

Make Editor title configurable again to fix accessibility issues #15208

jonbot opened this issue Oct 19, 2023 · 4 comments · Fixed by #16792
Assignees
Labels
domain:accessibility This issue reports an accessibility problem. domain:dx This issue reports a developer experience problem or possible improvement. domain:integration-dx This issue reports a problem with the developer experience when integrating CKEditor into a system. type:feature This issue reports a feature request (an idea for a new functionality or a missing option).

Comments

@jonbot
Copy link

jonbot commented Oct 19, 2023

📝 Provide a description of the new feature

For accessibility reasons, it would be great if CKEditor's voice-label <label> element could be configurable so that it could reflect the name of the field that CKEditor is replacing.

Screen readers read the "voice label" <label> value that is generated by CKEditor, which is always "Rich Text Editor."

For example, this instance:

Screen Shot 2023-10-18 at 3 09 20 PM

has this <label>:

<label class="ck ck-label ck-voice-label" id="ck-editor__label_e94ba4e316f3b958963791e09f1ad2e78">Rich Text Editor</label>

For users who rely on screen readers, it would be much more helpful if the reader uttered "Comment," and not "Rich Text Editor." (See https://www.w3.org/WAI/WCAG21/Understanding/labels-or-instructions.html, https://wcag.com/developers/3-3-2-labels-instructions.)

This value was made configurable in CKEditor4 with the config.title property: https://dev.ckeditor.com/ticket/12204.

After digging through CKEditor5 docs, I have not found a similar feature. I realize that the architecture of CKEditor 5 is vastly different than 4, but my proposal would be that the editor title/voice label be a configurable value -- if at all possible.

Additionally, the aria-label on <div class="ck-content" ...> should be removed. aria-label is only necessary if there is not an associated <label> tag. The effect of having both the <label> and the aria-label is that both are read by the screen reader -- which is confusing.

What is the expected behavior of the proposed feature?
A developer could add a title config value to the editor's create() method, and the generated voice label element would contain that title.

Something like:

ClassicEditor
	.create( document.querySelector( '#editor' ), {
	title: 'My Editor Title',
} )
...

would generate:

<label class="ck ck-label ck-voice-label" id="[some_id]">My Editor Title</label>

Additionally, the aria-label would be removed from the ck-content <div>:

[Edit: removed code example.]

Edit 10/20/23:
After some further research, I see that the aria-label is important for multi-root editors. So, I've removed that part of this request.


If you'd like to see this feature implemented, add a 👍 reaction to this post.

@jonbot jonbot added the type:feature This issue reports a feature request (an idea for a new functionality or a missing option). label Oct 19, 2023
@Witoso Witoso added domain:dx This issue reports a developer experience problem or possible improvement. domain:integration-dx This issue reports a problem with the developer experience when integrating CKEditor into a system. domain:accessibility This issue reports an accessibility problem. labels Oct 20, 2023
@jonbot jonbot changed the title Make Editor title configurable again and remove aria-label from ck-content div to fix accessibility issues Make Editor title configurable again to fix accessibility issues Oct 20, 2023
@CharlesBelov
Copy link

CharlesBelov commented Nov 2, 2023

I respectfully suggest this be a sitewide configuration setting, that the WYSIWYG would always use the visible field name as the label.

@wimleers
Copy link

This is also affecting Drupal, and we're working on adding a work-around until this is fixed: https://www.drupal.org/project/drupal/issues/3426798.

@wimleers
Copy link

Also, I would argue that type:feature is wrong here; it should be type:bug. 😅

@jannakha-copy-01
Copy link

+1
this issue fails WCAG 2.1 A: Success Criterion 4.1.2 - Name, Role, Value (label doesn't indicate the real name of the field)

oleq added a commit that referenced this issue Jul 31, 2024
Feature: Allowed to configure the accessible editable area label via `config.label` property. Closes #15208. Closes #11863. Closes #9731.

MINOR BREAKING CHANGE (ui): The default `aria-label` provided by `InlineEditableUIView` is now `'Rich Text Editor. Editing area: [root name]'` (previously `'Editor editing area: [root name]'`). You can use the `options.label` constructor property to adjust the label.
@oleq oleq self-assigned this Jul 31, 2024
@CKEditorBot CKEditorBot added this to the iteration 77 milestone Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:accessibility This issue reports an accessibility problem. domain:dx This issue reports a developer experience problem or possible improvement. domain:integration-dx This issue reports a problem with the developer experience when integrating CKEditor into a system. type:feature This issue reports a feature request (an idea for a new functionality or a missing option).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants