Problem
WCAG 2.5.3 Label in Name requires that the accessible name of a control contains the visible label text. The FieldStorageReuseForm "Re-use" button has an aria-label that spells the word differently and does not start with the visible text.
Visible text: "Re-use"
Accessible name: "Reuse @field_name"
The visible text "Re-use" (with hyphen) is not contained in the aria-label "Reuse" (without hyphen). A speech recognition user who says "Click Re-use" will not match.
Proposed resolution
Change the aria-label to start with the visible text "Re-use":
'aria-label' => $this->t('Re-use @field_name', ['@field_name' => $field['field_name']]),
File
core/modules/field_ui/src/Form/FieldStorageReuseForm.php — line 167
Test
Add a FunctionalJavascript test that:
- Visits the field storage reuse page
- Asserts each "Re-use" button's aria-label starts with the visible text "Re-use"
Related
AI Disclaimer: This was done with a lot of help from AI.
Comments
Comment #2
mgifford