Make WordPress Core


Ignore:
Timestamp:
10/07/2019 12:41:50 PM (6 years ago)
Author:
afercia
Message:

Accessibility: Media: Improve the search media field labelling.

Visible <label> elements benefit all users. The placeholder attribute should not be used as a replacement for visible labels.
Instead, it's supposed to be used only for a short hint to aid users with data entry e.g. a sample value or a brief description of the expected format.

Screen readers may not announce a placeholder attribute at all. Other users may suffer from the lack of a visible label and a placeholder used as replacement, for example:

  • users with cognitive disabilities may have trouble remembering what the filled field does
  • speech recognition users cannot see the name they can speak to set focus on the field
  • low-vision users with high text-size may not be able to see the whole placeholder even when it's visible, if its value is clipped by the edge of the input

Props anevins, audrasjb, karmatosed, azaozz, SergeyBiryukov, afercia.
See #40331.
Fixes #47138.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r46376 r46418  
    38493849        'filterByDate'                => __( 'Filter by date' ),
    38503850        'filterByType'                => __( 'Filter by type' ),
    3851         'searchMediaLabel'            => __( 'Search Media' ),
    3852         'searchMediaPlaceholder'      => __( 'Search media items...' ), // placeholder (no ellipsis)
     3851        'searchLabel'                 => __( 'Search' ),
     3852        'searchMediaLabel'            => __( 'Search Media' ), // backwards compatibility pre-5.3
     3853        'searchMediaPlaceholder'      => __( 'Search media items...' ), // placeholder (no ellipsis), backwards compatibility pre-5.3
    38533854        'mediaFound'                  => __( 'Number of media items found: %d' ),
    38543855        'mediaFoundHasMoreResults'    => __( 'Number of media items displayed: %d. Scroll the page for more results.' ),
Note: See TracChangeset for help on using the changeset viewer.