bupy7 / js-cropbox

A lightweight and simple js extension to crop your image.
http://bupy7.github.io/js-cropbox
5 stars 1 forks source link

Choosing the same picture after reset #11

Closed AhmedEmadAhmedABD closed 6 years ago

AhmedEmadAhmedABD commented 6 years ago

I am facing strange behavior after reset :
1- browse image and load it. 2- press reset. 3- try to choose the same image again

you will find that image doesn't load until you choose another one. is there any solution for this?

bupy7 commented 6 years ago

@AhmedEmadAhmedABD I have not the same behavior. What your browser?

AhmedEmadAhmedABD commented 6 years ago

chrome . it happens will browsing but I am use start code in on change event to load image automatically with no need to press start.

bupy7 commented 6 years ago

@AhmedEmadAhmedABD After load some image your file input caching. Therefore, you need reset cache of your file input manually before load new image.

AhmedEmadAhmedABD commented 6 years ago

Thanks a lot . form reset solved the problem. thanks for your rapid support.

bupy7 commented 6 years ago

@AhmedEmadAhmedABD can reset only input file like:

fileInput.files[0] = null;

I think that. But I didn't test it =)

https://developer.mozilla.org/en-US/docs/Web/API/FileList

AhmedEmadAhmedABD commented 6 years ago

I tried it but doesn't work . calling the following after reset solved the issue : this.form.reset();

bupy7 commented 6 years ago

@AhmedEmadAhmedABD hm... ok... what about

fileInput.value = null;

?

AhmedEmadAhmedABD commented 6 years ago

Yes . this works perfectly . thanks a lot again.