This accessibility report highlights a violation of WCAG 4.1.2 (Name, Role, Value) involving a checkbox within a Drupal file widget, specifically the element #edit-imagefile-file-limited-0-display. The issue is that the input field lacks a programmatically associated name, which prevents screen readers from conveying the purpose of the checkbox to users. To resolve this, the developer must provide an accessible label by either wrapping the input in a tag, using the for attribute to link an explicit label, or implementing ARIA attributes like aria-label or aria-labelledby. Ensuring this element is properly labeled is critical for making the form navigable and understandable for individuals using assistive technologies.

Note: AI was used to create the scripts that created this scanner and the corresponding report.

This is exposed with in File, with the Theming Tools module.

Pattern ID: DRU-6CA3D5EB
Rule: axe-core - label
Axe Rule URL: https://dequeuniversity.com/rules/axe/4.11/label
Severity: Critical (axe impact: critical)
WCAG SC: 1.3.1 - Info and Relationships (Level A)
Frequency: 4 of 452 pages (1%)
Selector: #edit-imagefile-file-limited-N-display
XPath: //[@id="edit-imagefile-file-limited-0-display"]
*Parent Context:
N/A

Affected URLs (full list):

Conditions:

  • admin (dark desktop, dark mobile, light desktop, light mobile), claro (dark desktop, dark mobile, light desktop, light mobile)

HTML Snippet

&lt;input <span class="hljs-keyword">class</span>=<span class="hljs-string">"file-display form-checkbox form-boolean form-boolean--type-checkbox"</span> data-drupal-selector=<span class="hljs-string">"edit-imagefile-file-limited-0-display"</span> type=<span class="hljs-string">"checkbox"</span> id=<span class="hljs-string">"edit-imagefile-file-limited-0-display"</span> name=<span class="hljs-string">"imagefile_file_limited[0][display]"</span> <span class="hljs-keyword">value</span>=<span class="hljs-string">"1"</span> <span class="hljs-keyword">checked</span>=<span class="hljs-string">"checked"</span>&gt;

Description

Fix any of the following:
Element does not have an implicit (wrapped)
Element does not have an explicit
aria-label attribute does not exist or is empty
aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
Element has no title attribute
Element has no placeholder attribute
Element's default semantics were not overridden with role="none" or role="presentation"

Steps to Reproduce

  1. Go to https://drupal-core.ddev.site/contact/imagefile_file
  2. Use the matching context from Conditions: admin (dark desktop, dark mobile, light desktop, light mobile), claro (dark desktop, dark mobile, light desktop, light mobile)
  3. Open browser DevTools and run axe.run() in the Console.
  4. Confirm rule label on selector #edit-imagefile-file-limited-N-display.

Expected Behaviour

Element and interaction meet the mapped WCAG success criterion.

Actual Behaviour

Fix any of the following:
Element does not have an implicit (wrapped)
Element does not have an explicit
aria-label attribute does not exist or is empty
aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
Element has no title attribute
Element has no placeholder attribute
Element's default semantics were not overridden with role="none" or role="presentation"

Impact

blind, low-vision, voice-control

Suggested Fix

See axe documentation.

Additional References

Testing Environment

Tracking IDs

  • Pattern ID: DRU-6CA3D5EB
  • Instance IDs: INS-94BD37A1, INS-B2D7B1D7, INS-7B9BD2A8, INS-F76BAB53

Comments

mgifford created an issue. See original summary.

mgifford’s picture

Issue summary: View changes
mgifford’s picture

Issue summary: View changes

Results of playwright axe scan from https://github.com/mgifford/drupal-core/blob/main/reports/PATTERN-REPORT...

Theme and style elements explicitly exposed using:
https://www.drupal.org/project/theming_tools
https://www.drupal.org/project/form_style

There are efforts to put in unique identifiers that will hopefully make this easier to search for and to find if there are issues that re-emerge.

It is an attempt to follow the best practices defined here:
https://mgifford.github.io/ACCESSIBILITY.md/examples/ACCESSIBILITY_BUG_R...

mgifford’s picture

Issue summary: View changes
quietone’s picture

Version: 11.3.x-dev » main

Changes are made on main first.

mgifford’s picture

Title: Mising labels for form elements » Missing labels in "Limited files with a single pre-existing value (required) field."
mgifford’s picture

Issue summary: View changes
mgifford’s picture

Issue tags: +theming tools