Skip to content

Commit 41a2eb2

Browse files
Max Fierkefernando-sendMail
Max Fierke
authored andcommitted
fix(dropdown): Fix $digest:inprog on dropdown dismissal
Make $apply first check if $rootScope is in $digest cycle before executing Closes angular-ui#3274
1 parent 57376a1 commit 41a2eb2

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/dropdown/dropdown.js

+3
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,14 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])
4040
return;
4141
}
4242

43+
<<<<<<< HEAD
4344
var $element = openScope.getElement();
4445
if( evt && openScope.getAutoClose() === 'outsideClick' && $element && $element[0].contains(evt.target) ) {
4546
return;
4647
}
4748

49+
=======
50+
>>>>>>> fix(dropdown): Fix $digest:inprog on dropdown dismissal
4851
openScope.isOpen = false;
4952

5053
if (!$rootScope.$$phase) {

src/dropdown/test/dropdown.spec.js

+3
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ describe('dropdownToggle', function() {
180180

181181
expect(element.hasClass('open')).toBe(false);
182182
});
183+
<<<<<<< HEAD
183184
});
184185

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

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

0 commit comments

Comments
 (0)