Skip to content

Commit

Permalink
fix(dropdown): Fix $digest:inprog on dropdown dismissal
Browse files Browse the repository at this point in the history
Make $apply first check if $rootScope is in $digest cycle before executing

Closes angular-ui#3274
  • Loading branch information
maxfierke authored and fernando-sendMail committed Jul 16, 2015
1 parent 57376a1 commit 41a2eb2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/dropdown/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,14 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])
return;
}

<<<<<<< HEAD
var $element = openScope.getElement();
if( evt && openScope.getAutoClose() === 'outsideClick' && $element && $element[0].contains(evt.target) ) {
return;
}

=======
>>>>>>> fix(dropdown): Fix $digest:inprog on dropdown dismissal
openScope.isOpen = false;

if (!$rootScope.$$phase) {
Expand Down
3 changes: 3 additions & 0 deletions src/dropdown/test/dropdown.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ describe('dropdownToggle', function() {

expect(element.hasClass('open')).toBe(false);
});
<<<<<<< HEAD
});

describe('using dropdown-append-to-body', function() {
Expand All @@ -200,6 +201,8 @@ describe('dropdownToggle', function() {
$rootScope.$digest();
expect($document.find('#dropdown-menu').length).toEqual(0);
});
=======
>>>>>>> fix(dropdown): Fix $digest:inprog on dropdown dismissal
});

describe('integration with $location URL rewriting', function() {
Expand Down

0 comments on commit 41a2eb2

Please sign in to comment.