Repository navigation
[6.x] Associate ui/Field labels with nested controls - #15573
Merged
Merged
Conversation
Field now generates an id for its label and lets the first nested control claim it, so screens like login get a proper for/id association without call-site changes. Explicit Field ids (Publish) are not injected, avoiding duplicate ids inside fieldtypes.
Member
|
@copilot resolve the merge conflicts in this pull request |
Co-authored-by: jackmcdade <44739+jackmcdade@users.noreply.github.com>
Contributor
Resolved the |
jackmcdade
approved these changes
Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Problem
ui/Fieldpassed:for="props.id"to its label, butidwas optional and omitted on most call sites (including login). Nested controls generated their own ids viauseId(), so the label’sforpointed at nothing and the control had no accessible name.axe-core reported critical
labelviolations on login, password reset, and other CP screens. WCAG 2.1 SC 1.3.1 and 4.1.2.What this PR Does
for, and exposes a labelidforaria-labelledbyInput,Textarea,Combobox/Select,Switch,Slider) claim that id viauseUiFieldIdfield_*), so nested controls inside fieldtypes don’t share duplicate idsid+aria-labelledby) when the search input isn’t rendered; puts Slider id on the thumbFixes #15389
How to Reproduce
/cp/auth/login(before this PR)id="v-0"(or similar) while the “Email” label hasfor=""labelviolation on both inputsAfter this PR, the label’s
formatches the input’sid.