Open juri33 opened 7 years ago
This is the current behaviour, unfortunately. I'm not sure if this "wanted" though.
This happens because after selecting a file, we change the input value to empty in order that selecting the same file will trigger a change event. See the issue here #77
I did not realize it will change the text of the button to "None selected".
Yes, I think it is possible to override the button text. But this is currently not supported. Would you like contributing your solution and write a pull request?
Thank you for your fast answer. Unfortunately we changed our requirement not to encode images :-|
@juri33 adonespitogo/angular-base64-upload@c23ab67?diff=unified#diff-10e55e709b2fd51c2729a0fc806ec6bfR190 it's working
@adonespitogo, is it an intended behaviour to clear the filename (which normally appears when a file is selected)?
No. This is a bug @htalat
@adonespitogo took a quick look at the code
scope._clearInput
is being called at the end of elem.on('change',fn)
at line 307
can i make a pull request after properly testing it out?
@htalat sure , much appreciated
@adonespitogo I don't understand why you have to clear the input after selecting a photo. If you are re-selecting the same one, the base64 string is already there in the model and hence no need to trigger the change event. The main feature of the directive is to get the base64 string which we already have, don't you agree?
Would you accept removing the scope._clearInput()
call?
This is the current behaviour, unfortunately. I'm not sure if this "wanted" though.
This happens because after selecting a file, we change the input value to empty in order that selecting the same file will trigger a change event. See the issue here #77
I did not realize it will change the text of the button to "None selected".
@htalat Please read the discussion here
I would accept removing scope._clearInput()
call if you can provide alternative solution for the issue when selecting the same file
ah, it seems that the only way to trigger the change event is to clear the input. So i'll then make the change on my fork then since it fits my use case.
thanks for your time! :)
How can i change the text in the input field? After selected a file the text is "None selected". Is this wanted behavior?
If i set breakpoint in my on-change function on angular.element("#input_imageUpload").innerHTML = this.uploadedImage.filename; i can see the filename in the input field but then it will be overwritten???
Is it also possible to change the input button text?