Automatically support expand all/collapse all

Created on 15 August 2024, 3 months ago

Problem/Motivation

The code does not appear to support adding expand all/collapse all. This can cause issues for people for whom accordions cause usability or accessibility issues:

  • People wishing to print the entire page.
  • People who use the browser find-in-page feature to find text.
  • People who are distracted by a lot of clicking.
  • People who are caused pain or time consumption by a lot of clicking.
  • People for who not being able to see multiple parts of the content at once creates a cognitive challenge.

It might also cause issues for screen reader users who list all links on a page. However, I don't have a way to test this across all screen readers.

It would be good if this module automatically added expand all/collapse all links before the accordion. At the very least, it could be an option enabled by default.

Steps to reproduce

I am unable to test this due to blocking issue πŸ› Adding accordion to CKEditor toolbar gets error Active but the code has no reference to "Expand all", so I'm pretty sure the module does not support it.

Proposed resolution

Automatically add "expand all" and "collapse all" links to an accordion.

Options to be decided:

  • Can administrators turn this feature off?
  • Can editors turn this feature on or off for a particular accordion?
  • What if there is more than one accordion on a page? Do we show this for each accordion (could be annoying if a page has many accordions) or do we show it once before the first accordion and have it apply to all accordions on the page? (I am suggesting show once - if one accordion causes problems for a site visitor, then likely all do and it would be annoying to have to keep activating it.)
  • If we do show only one expand all and collapse all pair regardless of the number of accordions on the page, does it belong immediately before the first accordion (makes the most cognitive sense) or at the top of the content (helps with find in page)?
  • If collapsed accordions hide links from screen reader link lists, does clicking the "expand all" link update the list? This would need to be tested across multiple screen readers. If it doesn't, there would need to be a way to reload the page with all accordions expanded, which might be a separate issue.

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States charles belov San Francisco, CA, US

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.

  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024