fix: set tabindex -1 on hidden tabs

This commit is contained in:
alistair3149 2024-06-02 14:00:36 -04:00
parent ac27855dec
commit 7e921a4a3a
No known key found for this signature in database

View file

@ -164,7 +164,8 @@ class TabberAction {
tabpanelVisibilityUpdates.push( { tabpanelVisibilityUpdates.push( {
element: tabpanel, element: tabpanel,
attributes: { attributes: {
'aria-hidden': 'false' 'aria-hidden': 'false',
tabindex: '0'
} }
} ); } );
if ( typeof resizeObserver !== 'undefined' && resizeObserver ) { if ( typeof resizeObserver !== 'undefined' && resizeObserver ) {
@ -174,7 +175,8 @@ class TabberAction {
tabpanelVisibilityUpdates.push( { tabpanelVisibilityUpdates.push( {
element: tabpanel, element: tabpanel,
attributes: { attributes: {
'aria-hidden': 'true' 'aria-hidden': 'true',
tabindex: '-1'
} }
} ); } );
if ( typeof resizeObserver !== 'undefined' && resizeObserver ) { if ( typeof resizeObserver !== 'undefined' && resizeObserver ) {