Accessibility: Media: Make screen readers announce the Media search results.

- adds audible messages via `wp.a11y.speak()` to announce the search results 
- removes a `keyup` event that was there only to support old browsers 
- removes `aria-modal="true"` from the media modal dialog as it prevents the ARIA live regions to be perceived by screen readers
- triggers the search only after 2 ASCII characters have been typed

Props anevins, antpb, aduth, loreleiaurora, afercia.
Fixes #47146.


git-svn-id: https://develop.svn.wordpress.org/trunk@46239 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrea Fercia
2019-09-23 12:18:53 +00:00
parent 8fdabdb621
commit 01b18e824f
7 changed files with 54 additions and 11 deletions
+4 -1
View File
@@ -3854,7 +3854,10 @@ function wp_enqueue_media( $args = array() ) {
'filterByType' => __( 'Filter by type' ),
'searchMediaLabel' => __( 'Search Media' ),
'searchMediaPlaceholder' => __( 'Search media items...' ), // placeholder (no ellipsis)
'noMedia' => __( 'No media files found.' ),
'mediaFound' => __( 'Number of media items found: %d' ),
'mediaFoundHasMoreResults' => __( 'Number of media items displayed: %d. Scroll the page for more results.' ),
'noMedia' => __( 'No media items found.' ),
'noMediaTryNewSearch' => __( 'No media items found. Try a different search.' ),
// Library Details
'attachmentDetails' => __( 'Attachment Details' ),