Opened 2 months ago
Last modified 6 weeks ago
#36640 new Cleanup/optimization
Error messages should use aria-errormessage — at Initial Version
| 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
#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](https://www.w3.org/TR/wai-aria-1.2/#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.