radio buttons and checkboxes should be grouped by fieldsets

Created on 9 March 2018, over 6 years ago
Updated 20 January 2023, almost 2 years ago

Problem/Motivation

The readability of forms by screen readers greatly improves with descriptive markup and structure. One way to do this, which is used for some groups of checkboxes and radio buttons, is through fieldsets. This gives the screen reader a label for the group (the legend) and tells the user how many elements are contained within the group. I believe this fits within the WCAG2.0 AA compliant goals of D8.

There are alternative approaches to giving screen readers this information. This bug captures one approach that relies on aria-describedby and aria-labeledby elements: https://www.drupal.org/project/drupal/issues/2896225 β†’

To compare the information given with and without fieldset formatting:
* Go to /node/add/article
* Turn on your computer's screen reader
* Navigate to Comment settings section (radio buttons contained within a fieldset)
* Navigate to the Promotion Options settings section (checkboxes not contained within a fieldset)

Proposed resolution

Since the use of fieldsets is already partially implemented (see CompositeFormElementTrait.php), I think it would make sense to expand this approach to groups of checkboxes or radio buttons more consistently.

πŸ› Bug report
Status

Active

Version

10.1 ✨

Component
FormΒ  β†’

Last updated about 24 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States sim_1

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
Production build 0.71.5 2024