Open kamilkp opened 8 years ago
Yes I've run into this same issue and took me a while to narrow it down to needing jQuery - thank you for confirming the reason behind this. Will this change be going into the repo?
Just found and tracked the same bug down. jQuery does a lot of things during cloning... there will not be an easy replacement for the .replaceWith method.
I'd propose removing it when on jQLite.
How did you resolve the issue?
So far my only solution has been to use jQuery I'm afraid. I tried including just the core jquery library without any modules to keep file size down, but that messed up my Angular app, which had deactivated jqLite altogether since it recognized jQuery was being used. So it's gotta be the full version of jQuery.
it seems if i add a this.bind
after the clone it works. to avoid the double binding based on jquery, would it be acceptable to clone just the html and then rebind the element instead? i really don't want this to be the only reason i have jquery in my project.
Hi.
I see in your source code that if an
input
hasmultiple
attribute; after the file(s) are selected in the file picker you clear out that input's value and also replace it with a clone of itself - this was introduced in this commitThe problem is that cloning an element and passing a
true
as an argument toclone
copies the event handlers only and only if we are on jQuery. It is broken on jqLite. So this results in a behavior that after selecting some file in the filepicker, the input is essentially useless (the clone doesn't have theonChange
event listener anymore).I could provide a jsfiddle, but one quick glance at angular's jqLite implementation of
clone
should be enough: