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

fix(tabs): exception when no selection and header clicked #11520

Merged
merged 1 commit into from
Jan 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/tabs/js/tabsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,9 @@ function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipp
*/
function redirectFocus () {
ctrl.styleTabItemFocus = ($mdInteraction.getLastInteractionType() === 'keyboard');
getElements().tabs[ ctrl.focusIndex ].focus();
if (ctrl.focusIndex > 0) {
getElements().tabs[ctrl.focusIndex].focus();
}
}

/**
Expand Down