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

Description
this piece has a memory leak where if user navigates through different pages , the hook to the click event does not die. So we will be adding a new event each time for each control. Especially for SPAs, this is a big issue. I have a simple fix for it and can make a PR if you let me.
if (scope.settings.closeOnBlur) {
$document.on('click', function (e) {
var target = e.target.parentElement;
var parentFound = false;
while (angular.isDefined(target) && target !== null && !parentFound) {
if (_.contains(target.className.split(' '), 'multiselect-parent') && !parentFound) {
if (target === $dropdownTrigger) {
parentFound = true;
}
}
target = target.parentElement;
}
if (!parentFound) {
scope.$apply(function () {
var bWasopen = false;
if (scope.open) bWasopen = true;
scope.open = false;
if (bWasopen) scope.externalEvents.onBlur();
});
}
});
}