Open afercia opened 7 years ago
If it is fine to allow fieldsets with another fieldset within (consider a fieldset section which has a radio field inside), I think this is a valuable enhancement.
If it is fine to allow fieldsets with another fieldset within
It is allowed but not recommended for accessibility. https://accessibility.blog.gov.uk/2016/07/22/using-the-fieldset-and-legend-elements/
It is possible to nest one
<fieldset>
element inside another, but it is not recommended. Screen readers do not automatically indicate the end of the<fieldset>
element, so it is impossible for screen reader users to confidently know which fields belong within which fieldset.
Not sure whether we should allow that then. I wouldn't like to add complex logic to disallow using fields that require fieldsets (radio for example) in fieldset sections. So it depends on whether we want to open up that possibility and risk accessibility issues, but on the other hand provide more flexibility.
Yep personally I'd prefer more flexibility and rely on devs education to avoid nested fieldsets (some documentation could help too).
There are cases where it would be worth grouping multiple fields within a fieldset element with a legend. Should
add_settings_section()
optionally output a fieldset with legend?