Problem/Motivation

CKEditor form validation errors are displayed as alerts ([role=alert]) but do not set aria-invalid="true" on the actual input fields, preventing screen readers from properly announcing which field has errors.

AI was used in the creation of this issue.

Steps to reproduce

Key Problems:

  • When CKEditor plugins have validation errors (e.g., "The following tag(s) are already supported...")
  • Errors appear as text alerts instead of marking the field as invalid
  • Screen readers can't identify which field needs correction
  • Form is not properly announced to assistive technology

Proposed resolution

  1. Modify CKEditor validation JavaScript to set aria-invalid="true" on fields with validation errors
  2. Ensure validation state is cleared when fields are corrected
  3. Test that screen readers can properly announce invalid field state
  4. Verify integration with the existing form label accessibility fix

Files to modify:
- core/modules/ckeditor5/src/ - CKEditor configuration and validation JavaScript
- core/modules/ckeditor5/tests/src/FunctionalJavascript/ - Add tests for aria-invalid behavior

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3614292

Command icon 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

mgifford created an issue. See original summary.

mgifford’s picture

Component: forms system » field system
Issue summary: View changes

mgifford’s picture

This is just a draft. I got part way into it and ran out of time so wanted to push it up so that others could rip it apart.

mgifford’s picture

Status: Active » Needs work

This needs work, but I think it is moving in the right direction.