cstefanache / angular2-img-cropper

Angular 2 Image Cropper
MIT License
364 stars 135 forks source link

selecting same image two times doesn't show/select image. #202

Open ghost opened 7 years ago

ghost commented 7 years ago

I am using ng2-image-cropper, when I select a image and displayed it, than I press clear method to remove selected image, and again I select same image, It is not showing in cropped box.

I have use (change)="fileChangeListener($event)".

Any idea??whats the issue, and how to solve it??

Thanks

dotnetdreamer commented 7 years ago

@SumanSingh4 check the browser cache maybe. Try selecting different photo next time.

ghost commented 7 years ago

@dotnetdreamer with selecting different picture its working fine, but I need both conditions to fulfill.

dotnetdreamer commented 7 years ago

@SumanSingh4 this is not this plugin issue as i said. You need to set the value of file input to null when value is changed. Check this https://stackoverflow.com/questions/12030686/html-input-file-selection-event-not-firing-upon-selecting-the-same-file

webcoderr commented 6 years ago

If you have for example <input type="file" #fileInput accept="image/*" (change)="uploadPhoto($event)" style="display: none;"> just make your button like this: <button class="btn btn-warning" (click)="fileInput.value=''">Cancel Hope this helps!