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.

Issue fork drupal-2951714

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sim_1 created an issue. See original summary.

mgifford’s picture

jrockowitz’s picture

@mgifford After reading that page it seems like the PasswordConfirm element, which contains two password elements, should also be considered a 'Grouping Controls' and wrapped in a fieldset with a legend.

mgifford’s picture

That makes sense to me @jrockowitz

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

larowlan’s picture

Issue tags: +Bug Smash Initiative

Is this a bug? It feels like a task

mgifford’s picture

Issue tags: +wcag131

Looks like a WCAG 1.3.1 issue so tagging.

reenaraghavan made their first commit to this issue’s fork.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

acbramley’s picture

Status: Active » Postponed (maintainer needs more info)

I don't think this is something that can be fixed generically, we'd need to fix each instance of these separately.

For example, the IS talks about the Promotion options on the node form. This is 2 boolean base fields, rendered as checkboxes via their widgets and then wrapped in a details element via NodeForm::form

Are there other specific examples we can target?

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

smustgrave’s picture

Since this is accessibility wanted to bump 1 more time for answer to #18

smustgrave’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Since there's been no follow up going to close out. It can always be re-opened but would be good to address #18 please.

Thanks all.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.