Exposed filter elements do not have aria-describedby attributes

Created on 23 May 2018, about 6 years ago
Updated 20 December 2023, 5 months ago

If a form-element includes a '#description' the Formbuilder adds an aria-describedby
$element['#attributes']['aria-describedby'] = $element['#id'] . '--description';

Now (this must be new) views renders descriptions in another way: they are now stored in $form['#info']

This is annoying in 2 ways:

  1. its not the typical Drupal-Way of the form api
  2. the automatic handling of 'aria-describedby' fails

btw - this aria-describedby is neccessary for screen-readers.

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated about 10 hours ago

Created by

πŸ‡©πŸ‡ͺGermany kle

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

Not all content is available!

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

  • πŸ‡ΊπŸ‡ΈUnited States dcam

    This problem was found by my accessibility reviewer today on a new site. I need to update the version so I can fork off 11.x.

  • Merge request !5890Draft: Added a failing test β†’ (Open) created by dcam
  • πŸ‡ΊπŸ‡ΈUnited States dcam

    Until this issue is patched, I'll be using the following code to work around it:

    function MYMODULE_preprocess_input__form_control__textfield(&$variables) {
      $element = $variables['element'];
      if (isset($element['#description']) && !isset($element['#attributes']['aria-describedby'])) {
        $description_id = $element['#id'] . '--description';
        $variables['attributes']->setAttribute('aria-describedby', $description_id);
      }
    }
    
Production build 0.69.0 2024