Open verheyenkoen opened 4 days ago
Tasty stuff!
Either we add an
id
attribute to the help text element and reference that using thearia-describedby
attribute on the form field element (preferred solution). Or we duplicate the help text in thearia-description
attribute on the form field, but then we'd also need to add thearia-hidden="true"
attribute to the help text so this information is not duplicated for them.
I'd go for the preferred solution so we don't have redundant code nor extra maintenance (duplicate text is doomed to be forgotten).
I'd go for the preferred solution so we don't have redundant code nor extra maintenance (duplicate text is doomed to be forgotten).
I just added the alternative in case the preferred solution is not "feasible" somehow. In case it's not, it should be a translated text anyway (I'll fix it if not), so it's still a one-place-edit.
Enhancement
In some places we have some help text below a field. Users using screen readers are missing this context since they will already have filled out the field before they notice the help text. This can be fixed by applying aria labels.
Either we add an
id
attribute to the help text element and reference that using the ~aria-describedby
~aria-details
attribute on the form field element (preferred solution). Or we duplicate the help text in thearia-description
attribute on the form field, but then we'd also need to add thearia-hidden="true"
attribute to the help text so this information is not duplicated for them.Here's an exhaustive list of fields to address:
Publications
<label>
)<label>
)Datasets
<label>
)Batch
[x] Additionally, we need to make sure all help texts are translated so they are not duplicated (especially in case we need the alternative solution, using
aria-description
).Screenshots
HTML currently generated for this field:
Additional context
https://getbootstrap.com/docs/5.0/forms/overview/#form-text
Automatic testing scenario
Ideally this is tested generically for forms. We'd need to query for
.form-text
instances and see if they are linked correctly to the previous field, either via ~aria-describedby
~aria-details
or duplicated inaria-description
but then the.form-text
element should also have thearia-hidden="true"
attribute.