Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove elements appended to body in ngf-select on $destroy #2056

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ciaran-phillips
Copy link

If the directive is added to something other than a file input, it adds
file input elements to the document body. Since these are outside of the
element the directive is applied to, they aren't automatically removed at
the end of its life.

The cleanup code for these elements already existed, but it was only being called
once when the directive was first applied, and wasn't actually removing anything. Now it
will be called on $destroy, and the file elements are correctly removed

If the directive is added to something other than a file input, it adds
file input elements to the document body. Since these are outside of the
element the directive is applied to, they aren't automatically removed at
the end of its life.

The cleanup code for these elements already existed, but it was only being called
once when the directive was first applied, and wasn't doing anything. Now it
will be called on $destroy, and the file elements are correctly removed
@ciaran-phillips
Copy link
Author

This fixes the memory leak previously described by @dani3l in #1222

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant