Updates to AJAX view filters for assistive technology

Created on 13 May 2023, over 1 year ago
Updated 16 September 2024, 4 months ago

Problem/Motivation

Currently if a user filters any kind of view that uses AJAX there is no notification to a screen reader user that content on the page has changed.

Steps to reproduce

  1. Create view through UI with exposed filters
  2. Enable AJAX on view
  3. Vist view to test filter and interact with exposed filter
  4. On submit no notification is provided for screen readers

Proposed resolution

Provide by default aria-live notifications when views with exposed filters are updated.

  1. Ideally the page/content would only change when the submit button is clicked
  2. aria-live=”polite” is located on the <header> in the view to update screen readers
  3. aria-live=”polite” is located on the no results option in the view to update screen readers

We could also consider leveraging the Drupal core announcement functionality to notify screen readers.

Remaining tasks

  • Open a new issue for creating notification text management feature
  • Implement Drupal Announce on exposed filter ajax submit
  • Add testing
  • Community testing & accessibility review
  • Make Drupal even more accessible!

User interface changes

Provide an option for editors to modify or adjust the text within the aria-live notification.

A potential example: Adjust notification to read x number of items found, users could replace `items` with term or content type.

API changes

TBD

Data model changes

No changes anticipated.

Feature request
Status

Active

Version

11.0 🔥

Component
Views 

Last updated about 2 hours ago

Created by

🇺🇸United States jldust

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.

  • Issue created by @jldust
  • 🇨🇦Canada mgifford Ottawa, Ontario

    I think this fits under WCAG SC 4.1.3.

  • 🇺🇸United States AaronBauman Philadelphia

    Using Announce seems like the way to go here, since that already defines an aria-live component.

    Ideally the page/content would only change when the submit button is clicked

    Pretty sure this is how exposed filters work, unless you have a contrib like Better Exposed Filters configured to autosubmit.

    Provide an option for editors to modify or adjust the text within the aria-live notification.

    This sounds like it could be a can of worms. Possibly a good candidate to split into another issue so we don't hold up the basic functionality here. Implementers can use the language string override feature in the meantime.

Production build 0.71.5 2024