Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 704e259

Browse files
Splaktarjelbourn
authored andcommitted
fix(tabs): tabbing into tabs component requires an extra tab key press (#11633)
Fixes #11632
1 parent 9f458f6 commit 704e259

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/tabs/js/tabsController.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,9 @@ function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipp
702702
*/
703703
function redirectFocus () {
704704
ctrl.styleTabItemFocus = ($mdInteraction.getLastInteractionType() === 'keyboard');
705-
if (ctrl.focusIndex > 0) {
706-
getElements().tabs[ctrl.focusIndex].focus();
705+
var tabToFocus = getElements().tabs[ctrl.focusIndex];
706+
if (tabToFocus) {
707+
tabToFocus.focus();
707708
}
708709
}
709710

0 commit comments

Comments
 (0)