Make WordPress Core

Changeset 46438


Ignore:
Timestamp:
10/08/2019 05:05:53 PM (6 years ago)
Author:
afercia
Message:

Accessibility: Media: Improve the logic to render the ARIA tabs markup after [46363].

Additionally checks for the "menu" and "router" state attributes to better determine when the ARIA tabs pattern markup is appropriate.

See #47149.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/media/views/media-frame.js

    r46363 r46438  
    104104        tabPanelEl.removeAttr( 'role aria-labelledby tabindex' );
    105105
    106         if ( this.menuView && this.menuView.isVisible ) {
     106        if ( this.state().get( 'menu' ) && this.menuView && this.menuView.isVisible ) {
    107107            ariaLabelledby = 'menu-item-' + stateId;
    108108
     
    130130        tabPanelEl.removeAttr( 'role aria-labelledby tabindex' );
    131131
    132         // On the Embed view the router menu is hidden.
    133         if ( 'embed' === this.content._mode ) {
    134             return;
    135         }
    136 
    137132        // Set the tab panel attributes only if the tabs are visible.
    138         if ( this.routerView && this.routerView.isVisible && this.content._mode ) {
     133        if ( this.state().get( 'router' ) && this.routerView && this.routerView.isVisible && this.content._mode ) {
    139134            ariaLabelledby = 'menu-item-' + this.content._mode;
    140135
Note: See TracChangeset for help on using the changeset viewer.