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

memory leak #474

Description

@javid-p84

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();
                    });
                }
            });

        }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions