Make WordPress Core


Ignore:
Timestamp:
06/12/2019 09:02:03 PM (4 years ago)
Author:
afercia
Message:

Accessibility: Improve focus management in the Media Views.

  • keeps focus management only where necessary to avoid focus losses
  • removes focus management where a specific user workflow was assumed
  • makes the "Attachment Details" navigation buttons really disabled when there are no next or previous attachments
  • adds inline comments to clarify all the usages of focus()

Fixes #43169.

File:
1 edited

Legend:

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

    r45506 r45524  
    324324    <script type="text/html" id="tmpl-edit-attachment-frame">
    325325        <div class="edit-media-header">
    326             <button class="left dashicons <# if ( ! data.hasPrevious ) { #> disabled <# } #>"><span class="screen-reader-text"><?php _e( 'Previous' ); ?></span></button>
    327             <button class="right dashicons <# if ( ! data.hasNext ) { #> disabled <# } #>"><span class="screen-reader-text"><?php _e( 'Next' ); ?></span></button>
     326            <button class="left dashicons"<# if ( ! data.hasPrevious ) { #> disabled<# } #>><span class="screen-reader-text"><?php _e( 'Edit previous media item' ); ?></span></button>
     327            <button class="right dashicons"<# if ( ! data.hasNext ) { #> disabled<# } #>><span class="screen-reader-text"><?php _e( 'Edit next media item' ); ?></span></button>
    328328            <button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text"><?php _e( 'Close dialog' ); ?></span></span></button>
    329329        </div>
Note: See TracChangeset for help on using the changeset viewer.