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

Commit

Permalink
fix(tabs): fixes errors thrown when user-defined click events triggered
Browse files Browse the repository at this point in the history
their own digest cycles
  • Loading branch information
Robert Messerle committed Jul 23, 2015
1 parent 3012b4a commit 1b984ed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/tabs/js/tabsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,10 @@ function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipp
function select (index) {
if (!locked) ctrl.focusIndex = ctrl.selectedIndex = index;
ctrl.lastClick = true;
ctrl.tabs[ index ].element.triggerHandler('click');
// nextTick is required to prevent errors in user-defined click events
$mdUtil.nextTick(function () {
ctrl.tabs[ index ].element.triggerHandler('click');
}, false);
}

/**
Expand Down

0 comments on commit 1b984ed

Please sign in to comment.