-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Created file input, when using ngf-select on button, is not removed on button removal #783
Comments
This is also messing with the layout of our site as the elements take up space at the bottom of the page, causing the scroll bar to show. You should at least position them at the top-left. Had to work-around this with some custom CSS
|
I'm working around this by adding a custom attribute to my
then removing these when the parent scope (controller, directive) is destroyed
|
There is a simpler solution to this issue, reference to the created file input is saved on the button element under "ngf_ref_elem" property, so I can write directive like this: link: function (scope, element) {
scope.$on('$destroy', function () {
if (element.__ngf_ref_elem__) {
element.__ngf_ref_elem__.remove();
element.__ngf_ref_elem__ = null;
}
});
} and put it on the button element. I still hope, that this issue will be fixed internally in the library. |
Fixed in version 5.0.0 |
When using ngf-select directive on button element additional file input is created and attached to the bottom of the body. The problem is, that when the button element is removed and its scope is destroyed, previously created file input is not removed from the DOM. This problem leads to a situation, when multiple file inputs can remain in the DOM. To fix this issue the library should remove created file input on scope/element destroy.
The text was updated successfully, but these errors were encountered: