Details do not benefit from aria-pressed

Created on 21 November 2023, 10 months ago
Updated 2 March 2024, 7 months ago

Problem/Motivation

According to testing done at the Helsinki University current details element has excess aria attributes that add to screen reader output without providing useful information.
<summary role="button" aria-controls="edit-group-test" aria-expanded="false" aria-pressed="false" class="claro-details__summary">
Aria-attribute "aria-pressed" is perceived unnecessary and confusing. It was not found to be needed for legacy compatibility either in a quick search.

One blog seemed to have credible details on details and suggests that the code could be simplified further - but some of the currently maybe not required code may help legacy software users.
https://www.scottohara.me/blog/2018/09/03/details-and-summary.html
https://www.scottohara.me/blog/2022/09/12/details-summary.html

Steps to reproduce

Create a form that includes a details element.

For testing I used a stable Drupal 10.1.x and contrib module field_group - but the code for aria-pressed comes from core and is present in 11.x-dev.

Proposed resolution

Remove attribute "aria-pressed" from default details element.

User interface changes

Screenreader output is cleaner, there should not be other changes.

📌 Task
Status

Fixed

Version

10.2 ✨

Component
Form  →

Last updated 37 minutes ago

Created by

🇫🇮Finland simohell

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024