Problem/Motivation

The bullet points are announced when you step through the list of errors in the summary with the VoiceOver cursor. They should not be announced.

Originally reported by @rkoller in Slack.

See the attached video ife-summary-bullet-points-announced.mp4.

The summary is meant to be a comma list with no bullets at all. The bullets only show up because the comma list CSS never reaches the page. item-list.module.css moved into the core/drupal.item-list library in #3512285: Split item-list.module.css out to its own library, and the summary is rendered with renderInIsolation(), so its attachments are lost. See #5 for the details.

Steps to reproduce

  1. Install Drupal with Inline Form Errors enabled.
  2. Go to /user/login and press Log in with both fields empty.
  3. Look at the error message. "2 errors have been found:" is followed by a bulleted list of links, not a comma separated sentence.
  4. With VoiceOver on macOS and Safari, step through the message with VO plus Right Arrow. VoiceOver says "bullet" before each link.

Proposed resolution

Attach core/drupal.item-list to the form in the Inline Form Errors handler when the form has errors, so the library reaches the page with the form. The MR overrides handleFormErrors(), calls the parent, and attaches the library unless #disable_inline_form_errors is set. It also adds a functional test that fails without the fix.

Remaining tasks

  • Review the MR.
  • Decide whether AJAX submits where the callback returns only part of the form need handling here or in a follow-up.

User interface changes

The error summary shows as a comma separated list again, and screen readers no longer announce bullets.

Introduced terminology

API changes

Data model changes

Release notes snippet

LLM disclosure

LLM assistance (Claude Opus 5.5) was used to identify and propose a resolution to this issue, and the change was reviewed with OpenAI Codex. I reproduced the bug and verified the fix with VoiceOver.

Issue fork drupal-3614747

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

kentr created an issue. See original summary.

mgifford’s picture

Is announcing the bullets an error or simply audio clutter? It's the same behaviour here:

https://www.w3.org/WAI/tutorials/page-structure/content/

ykhalid made their first commit to this issue’s fork.

ykhalid’s picture

Status: Active » Needs review

I'm a VoiceOver user and I can reproduce this, and I think I found the cause. To answer @mgifford's question in #2: I don't think it's audio clutter in the same way as the W3C page. The summary is meant to be a comma list with no bullets at all. The bullets only show up because the comma list CSS never reaches the page.

Steps to reproduce:

  1. Install Drupal with Inline Form Errors enabled.
  2. Go to /user/login and press Log in with both fields empty.
  3. Look at the error message. "2 errors have been found:" is followed by a bulleted list of links, not a comma separated sentence.
  4. With VoiceOver on macOS and Safari, step through the message with VO plus Right Arrow. VoiceOver says "bullet" before each link.

Cause:

  • The summary is rendered as an item list with list_style comma-list. The styles that remove the bullets live in item-list.module.css. Before 11.3 that file was in system/base, which loads on every page. #3512285: Split item-list.module.css out to its own library moved it into its own core/drupal.item-list library (change record https://www.drupal.org/node/3530832) to cut unused CSS, and it is now attached from the item list preprocess.
  • That library is attached in preprocessItemList(), but the summary template uses include('item-list.html.twig'), so the preprocess never runs.
  • Even if it did, FormErrorHandler renders the summary with renderInIsolation() and passes only the markup string to the messenger, so any #attached on it is lost.
  • So no page with the summary gets the comma list CSS, unless something else on the page happens to render an item list.

I checked the markup on a clean install of main (default_admin and stark) and on an 11.4 site with an Olivero based theme. The page loads no item-list.module.css on the error response. The video in the summary matches this: VoiceOver reads "list, 4 items" and then "bullet, 1 of 4" before each error link.

Proposed resolution:

Attach core/drupal.item-list to the form in the Inline Form Errors handler when the form has errors, so the library reaches the page with the form. The MR overrides handleFormErrors(), calls the parent, and attaches the library unless #disable_inline_form_errors is set.

Testing:

  • The MR adds a functional test, FormErrorHandlerSummaryStylesTest. It submits the login form empty, checks that the error summary has its links, and checks that item-list.module.css is on the page. I ran it with and without the fix on the stark and default_admin themes. It fails without the fix and passes with it.
  • All existing inline_form_errors tests (unit, kernel and functional) pass, and phpcs is clean.
  • With VoiceOver on macOS Safari: before the fix, "bullet" before each link. After the fix, no bullets, and the links still move to their fields.

One thing I'd like a maintainer's opinion on: for an AJAX submit where the callback returns only part of the form, the top level #attached isn't part of the response, so the bullets could still show there. Should that be handled here, or in a follow-up?

LLM disclosure: LLM assistance (Claude Opus 5.5) was used to identify and propose a resolution to this issue, and the change was reviewed with OpenAI Codex. I reproduced the bug and verified the fix with VoiceOver.

ykhalid’s picture

Issue summary: View changes
rkoller’s picture

Status: Needs review » Needs work
StatusFileSize
new937.25 KB
new17.11 KB

With MR17931 the previously styled bulleted list becomes a comma delimited inline list of links (see MR17931.mp4).
error message about three errors have been found displayed as a comma separated list of three link

  • For sighted users this is a regression, the information becomes more difficult to read. the readability decreases that way.
  • For screenreaders (within voiceover) each comma between two links becomes an additional step in the voiceover stepper with VO-right arrow key.
  • Each of the three links is only 20px high, the required minimum is 24px for SC2.5.8 (minimum target size)
ykhalid’s picture

Thank you, @rkoller, for testing this and for the video. I went and rechecked it with VoiceOver on Safari, and with my punctuation set to All, each comma is its own stop between the links. With my usual setting (Some), the comma isn't spoken, but the stop is still there. So bringing back the comma list doesn't help screen reader users either.

@mgifford, thank you too. I think you were right in #2. A bulleted list is a normal way to mark up a group of links (WCAG technique H48), and that's the same list behavior you pointed to on the W3C page.

I think the better fix is to make the bulleted list the intended design. That means dropping context: {list_style: 'comma-list'} from inline-form-errors-summary.html.twig, so the summary is a normal list on purpose and not just because the CSS is missing. VoiceOver saying "bullet" before each link would then be expected list behavior.

For target size, the stacked links would still need either 24 pixels of height or enough space between them.

If people agree with this direction, I'll update the MR.