Skip to content
This repository was archived by the owner on Dec 16, 2019. It is now read-only.

Commit 0a4ce8b

Browse files
committed
Merge pull request #18 from gkond/master
fix: closeOnBlur works properly with multiple dropdowns
2 parents 7c9afec + 8dace7b commit 0a4ce8b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/angularjs-dropdown-multiselect.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ directiveModule.directive('ngDropdownMultiselect', ['$filter', '$document', '$co
5454
element.html(template);
5555
},
5656
link: function ($scope, $element, $attrs) {
57+
var $dropdownTrigger = $element.children()[0];
58+
5759
$scope.toggleDropdown = function () {
5860
$scope.open = !$scope.open;
5961
};
@@ -150,7 +152,9 @@ directiveModule.directive('ngDropdownMultiselect', ['$filter', '$document', '$co
150152

151153
while (angular.isDefined(target) && target !== null && !parentFound) {
152154
if (_.contains(target.className.split(' '), 'multiselect-parent') && !parentFound) {
153-
parentFound = true;
155+
if(target === $dropdownTrigger) {
156+
parentFound = true;
157+
}
154158
}
155159
target = target.parentElement;
156160
}

0 commit comments

Comments
 (0)