馃挕 Form Widget - fieldset/legend for checkboxes and radios [accessibility] #37253
alddesign
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Describe the Problem
I think it would improve accessibility if form inputs like checkboxes and radios would be rendered in a fieldset, with a legend that describes the selection the user is performing.
Right now the html for a group of checkboxes looks like this (simplified):
The issues here is that the first label is orphaned and can not be associated with the checkboxes by assistive technologies. The labels for the individual checkboxes are fine tho.
Propose a Solution
The solution would be to wrap the checkboxes in a fieldset, and replace the first label with a legend. Like this (again, simplified):
Additional Context
To avoid compatibility issues (as the output html will change), a simple toggle switch on wiget or field level would do it. Something like "aggregate in fieldset".
Agreement
All reactions