Skip to content

Commit

Permalink
Tabs: Fixed focus handling for external tab links
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Jackson authored and Paul Jackson committed Nov 14, 2014
1 parent 8a808ef commit 7bdbedb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/plugins/tabs/tabs.js
Expand Up @@ -494,11 +494,11 @@ var componentName = "wb-tabs",
$panel = $( panelSelector );

if ( isSmallView && $panel[ 0 ].nodeName.toLowerCase() === "details" ) {
if ( !$panel.attr( "open" ) ) {
$panel.children( "summary" ).trigger( "click" );
}
$panel.children( "summary" ).trigger( $panel.attr( "open" ) ? setFocusEvent : "click" );
} else {
$( panelSelector + "-lnk" ).trigger( "click" );
$( panelSelector + "-lnk" )
.trigger( "click" )
.trigger( setFocusEvent );
}
},

Expand Down Expand Up @@ -809,7 +809,7 @@ $document.on( "click keydown", selector + " [role=tabpanel]", function( event )
$( currentTarget )
.closest( selector )
.find( "[href$='#" + currentTarget.id + "']" )
.trigger( "setfocus.wb" );
.trigger( setFocusEvent );
}
}
});
Expand Down

0 comments on commit 7bdbedb

Please sign in to comment.