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

Commit 9c079aa

Browse files
Splaktarmmalerba
authored andcommitted
fix(tabs): exception when no selection and header clicked (#11520)
Fixes #10042
1 parent 45e92ea commit 9c079aa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/tabs/js/tabsController.js

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

708710
/**

0 commit comments

Comments
 (0)