Skip to content

Commit 1ab9993

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/trunk@61626 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 7da7a09 commit 1ab9993

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/js/media/views/media-frame.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ MediaFrame = Frame.extend(/** @lends wp.media.view.MediaFrame.prototype */{
101101
tabPanelEl = this.$el.find( '.media-frame-tab-panel' ),
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 ) {
107107
ariaLabelledby = 'menu-item-' + stateId;
@@ -111,7 +111,6 @@ MediaFrame = Frame.extend(/** @lends wp.media.view.MediaFrame.prototype */{
111111
.attr( {
112112
role: 'tabpanel',
113113
'aria-labelledby': ariaLabelledby,
114-
tabIndex: '0'
115114
} );
116115
}
117116
},
@@ -127,7 +126,7 @@ MediaFrame = Frame.extend(/** @lends wp.media.view.MediaFrame.prototype */{
127126
var tabPanelEl = this.$el.find( '.media-frame-content' ),
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.
133132
if ( this.state().get( 'router' ) && this.routerView && this.routerView.isVisible && this.content._mode ) {
@@ -137,7 +136,6 @@ MediaFrame = Frame.extend(/** @lends wp.media.view.MediaFrame.prototype */{
137136
.attr( {
138137
role: 'tabpanel',
139138
'aria-labelledby': ariaLabelledby,
140-
tabIndex: '0'
141139
} );
142140
}
143141
},

0 commit comments

Comments
 (0)