Opened 3 weeks ago
Last modified 4 days ago
#36640 new Cleanup/optimization
Error messages should use aria-errormessage
| Reported by: | Tobias Bengfort | Owned by: | |
|---|---|---|---|
| Component: | Forms | Version: | 5.2 |
| Severity: | Normal | Keywords: | accessibility, ui, forms |
| Cc: | Triage Stage: | Someday/Maybe | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | yes |
Description (last modified by )
#32819 added aria-describedby to associate help texts and errors with their inputs. I recently learned that there is also the more specialized aria-errormessage.
I am not sure if using aria-describedby over aria-errormessage was a conscious decision.
One issue might be that aria-errormessage seems to be intended for client side validation. It must be used with aria-invalid="true". See also https://github.com/w3c/aria/issues/2048 for a discussion of the differences between aria-describedby and aria-errormessage.
Change History (5)
comment:1 by , 3 weeks ago
| Description: | modified (diff) |
|---|
comment:2 by , 13 days ago
comment:3 by , 12 days ago
| Triage Stage: | Unreviewed → Someday/Maybe |
|---|
Thanks @Antoliny0919 for the triage. Marking as Someday/Maybe because of limited coverage.
comment:4 by , 5 days ago
Hello sir, @Antoliny0919 Should I start working on this issue if it's not assigned??
comment:5 by , 4 days ago
It is probably best to wait until we hear from the accessibility team and this ticket moves out of "Someday/Maybe" status.
Thank you Tobias :)
I like this proposal.
I looked into the materials you provided and also researched
aria-errormessage.It does seem that providing error messages through a
ria-errormessage, instead of including both the error message and help text inaria-describedby, offers more advantages.However, the problem lies in the support coverage of
aria-errormessage.It appears that
aria-errormessageis not yet supported by macOS VoiceOver and TalkBack.While it is supported by screen readers with higher market share( NVDA, JAWS, and iOS VoiceOver..), I wasn’t able to confidently triage this issue because of that limitation.
If we switch to using
aria-errormessage, devices that don’t support it won’t read out the error message at all, which could actually make the experience worse than before.So I think it would be best to get the accessibility team opinion on this.