alphagov / govuk-frontend

GOV.UK Frontend contains the code you need to start building a user interface for government platforms and services.
https://frontend.design-system.service.gov.uk/
MIT License
1.18k stars 325 forks source link

Improve documentation of `beforeInput(s)` and `afterInput(s)` options of our form control components #5130

Open romaricpascal opened 4 months ago

romaricpascal commented 4 months ago

What

Research and document which kind of content is OK/not OK to put in the beforeInput(s) and afterInput(s) options of our form components, introduced in #4567 to ensure all users (especially those using assistive technology) get proper access to the content.

Why

Because the content ends up inside a form field, where the control is associated to the label/legend and any error/hint, there's a risk that content injected through beforeInput(s)/afterInput(s) options gets missed when navigating from field to field, the focus skipping over the content to the next form field.

This means we may want to suggest restrictions as to which content is suitable for these options, possible techniques to link the content so it gets announced when navigating from field to field, and possibly a warning to test thoroughly.

Who needs to work on this

Developers, Accessibility specialist, possibly Designers

Who needs to review this

Developers, Accessibility specialist, possibly Designers

Done when