citizensadvice / design-system

Citizens Advice Design System
https://citizens-advice-design-system.netlify.app/
Apache License 2.0
31 stars 7 forks source link

fix: ensure erroring radio buttons are described by the error message #3527

Closed davidsauntson closed 2 weeks ago

davidsauntson commented 2 weeks ago

Changes how the error message and the radio buttons are rendered to make sure that aria-describedby is added to the buttons and references the error message paragraph. This means that the radio group error message is announced when a radio button in a group with an error gets focus, following the pattern here: https://russmaxdesign.github.io/accessible-forms/fieldset-error04.html. This was discussed in the accessibilty working group as part of @danielnissenbaum discussion about error summaries and the screen reader journey from error to input.