Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
fix(dropdown): Fix $digest:inprog on dropdown dismissal
Browse files Browse the repository at this point in the history
Could occur when click event handled during digest cycle (through another directive, etc.)

Signed-off-by: Max Fierke <[email protected]>
  • Loading branch information
maxfierke committed Mar 24, 2015
1 parent 13bd516 commit fc86a87
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/dropdown/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ angular.module('ui.bootstrap.dropdown', [])
openClass: 'open'
})

.service('dropdownService', ['$document', function($document) {
.service('dropdownService', ['$document', '$rootScope', function($document, $rootScope) {
var openScope = null;

this.open = function( dropdownScope ) {
Expand Down Expand Up @@ -38,9 +38,11 @@ angular.module('ui.bootstrap.dropdown', [])
return;
}

openScope.$apply(function() {
openScope.isOpen = false;
});
openScope.isOpen = false;

if (!$rootScope.$$phase) {
openScope.$apply();
}
};

var escapeKeyBind = function( evt ) {
Expand Down

0 comments on commit fc86a87

Please sign in to comment.