Required file fields are not programmatically identified for assistive technology.

Created on 15 February 2017, about 8 years ago
Updated 6 May 2025, 8 days ago

Asterisks for certain fields are not announced by JAWS. As an example within the “Create Image” screen, the “Image Upload *” button is announced by JAWS as, “Image upload file upload edit browse…” instead of being correctly announced as e.g. “Image upload required file upload edit browse…”

The defect exists in IE 11 and Google Chrome v55.0.2883.87 m.

Expected result: All asterisks are expected to be announced by JAWS. For example required red asterisk is expected to be made available for JAWS to read with the associated form title e.g., “Image upload required file upload edit browse…”

Reference: Section 508, Part 1194.22, Paragraph (n).

Notes:
• This defect may exist elsewhere within the application.
• This defect exists on a screen that is not accessible via a keyboard. The tester was forced to use the mouse to access this screen, which is not acceptable for a JAWS user.

🐛 Bug report
Status

Active

Version

11.0 🔥

Component

file.module

Created by

🇺🇸United States kershme

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.

  • html5

    Implements and supports the use of HTML5.

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.

  • 🇺🇸United States dcam

    If you need a workaround for this issue, then you can put this in your custom theme:

    /**
     * Implements hook_element_info_alter().
     */
    function MY_THEME_element_info_alter(array &$info) {
      $info['managed_file']['#process'][] = '_MY_THEME_process_managed_file_element';
    }
    
    /**
     * Processes managed file elements.
     *
     * A required attribute isn't set on the child upload element and it can't be
     * done in a preprocess function. It must be set before the element is
     * rendered.
     *
     * @param array element
     *   A managed file form element.
     *
     * @return array
     *   The processed managed file element.
     *
     * @see https://www.drupal.org/project/drupal/issues/2852874
     */
    function _MY_THEME_process_managed_file_element(array $element) {
      if (isset($element['#required']) && $element['#required']) {
        $element['upload']['#required'] = TRUE;
      }
      return $element;
    }
    

    I'll see about fixing it properly in Drupal Core another time.

Production build 0.71.5 2024