fix(many): keep form field messages out of the control's accessible name#2625
Open
git-nandor wants to merge 1 commit into
Open
fix(many): keep form field messages out of the control's accessible name#2625git-nandor wants to merge 1 commit into
git-nandor wants to merge 1 commit into
Conversation
|
Visual regression report✅ No changes.
Baselines come from the |
ToMESSKa
requested changes
Jul 7, 2026
Comment on lines
+241
to
+242
| // Any consumer-provided `aria-labelledby` (e.g. Select's pill handling) | ||
| // takes precedence. |
Contributor
There was a problem hiding this comment.
I think the Select's pill handling doesn't use aria-labelledby anymore see #2616 (comment) so this is not a relevant example
Form control messages (error/hint/success) render inside the wrapping <label>, so they were read as part of the field's accessible name. Point each control's name at the label text via aria-labelledby and reference the messages via aria-describedby, so screen readers announce them as the field's description. Label click-to-focus is preserved. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
9e15d7b to
8d8c8f4
Compare
ToMESSKa
requested changes
Jul 9, 2026
ToMESSKa
left a comment
Contributor
There was a problem hiding this comment.
A vitest test is failing, can you please check?
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.
INSTUI-4724
Summary
Form control messages render inside the wrapping , so screen readers were reading them as part of the field's accessible name (e.g. "Password Password must be at least 6 characters") instead of as a description.
Each single form control now points its accessible name at the label text only (aria-labelledby) and references the messages as its description (aria-describedby), so a screen reader announces the label first, then the messages. The wrapping is unchanged, so click-on-label focus is preserved.
Test plan
Tab through the given exaple and verify in DevTools Accessibility tab that the Name and Description values are correct. With a screen reader enabled, confirm that the label is announced as the field name, followed by a brief pause before the description is announced.
Co-Authored-By: 🤖 Claude