Skip to content

Commit

Permalink
fix(button): remove md-focused class on mouseleave
Browse files Browse the repository at this point in the history
md-button was retaining focus on mouseleave, this was especially visible on buttons with tooltips that get focused on hover (see angular#4249).

Fixes angular#4249 angular#4329
  • Loading branch information
Androguide committed Sep 11, 2015
1 parent 316b4c8 commit c346c54
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/button/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ function MdButtonDirective($mdButtonInkRipple, $mdTheming, $mdAria, $timeout) {
.on('focus', function() {
if (scope.mouseActive === false) { element.addClass('md-focused'); }
})
.on('mouseleave', function() {
element.removeClass('md-focused');
})
.on('blur', function() { element.removeClass('md-focused'); });
}

Expand Down

0 comments on commit c346c54

Please sign in to comment.