Make WordPress Core

Changeset 61626


Ignore:
Timestamp:
02/12/2026 07:33:19 PM (8 months ago)
Author:
joedolson
Message:

Media: A11y: Remove tabindex on tabpanels.

Tabindex should be set on a tabpanel if there is content in that tabpanel that is not focusable. The media library uses tabpanels, but the first content is either focusable or redundant.

Change the media library tabpanels to omit tabindex attributes.

Props alh0319, joedolson, westonruter, huzaifaalmesbah.
Fixes #63984.

File:
1 edited

Legend:

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

    r46800 r61626  
    102102                        ariaLabelledby;
    103103
    104                 tabPanelEl.removeAttr( 'role aria-labelledby tabindex' );
     104                tabPanelEl.removeAttr( 'role aria-labelledby' );
    105105
    106106                if ( this.state().get( 'menu' ) && this.menuView && this.menuView.isVisible ) {
    … …  
    112112                                        role: 'tabpanel',
    113113                                        'aria-labelledby': ariaLabelledby,
    114                                         tabIndex: '0'
    115114                                } );
    116115                }
    … …  
    128127                        ariaLabelledby;
    129128
    130                 tabPanelEl.removeAttr( 'role aria-labelledby tabindex' );
     129                tabPanelEl.removeAttr( 'role aria-labelledby' );
    131130
    132131                // Set the tab panel attributes only if the tabs are visible.
    … …  
    138137                                        role: 'tabpanel',
    139138                                        'aria-labelledby': ariaLabelledby,
    140                                         tabIndex: '0'
    141139                                } );
    142140                }
Note: See TracChangeset for help on using the changeset viewer.