I have this issue both in my code and also in the demo (https://angular-file-upload.appspot.com/).
The scenario is:
I upload an image by clicking on the "click to select" area and choose an image from the dialog. The image is uploaded after a couple of seconds. When it's uploaded and I click on the "click to select" area again, the preview is removed and the model behind is reset.
Expected behaviour: the preview is not removed even if I choose "Cancel" in the dialog.
Is this possible to achieve by configuring this component somehow?
There is no consistent cross browser way to detect choosing "Cancel" on the dialog. So the model is being reset on click to allow selecting the same file again and to remove the file if the user cancels the popup.
Is there any workaround for this problem? I have a use-case for multiple uploads, say i have uploaded 3 images and previewing it and now i want to add another image and when i click upload button(even if i click "Cancel") again it reset's the model and i need to upload again all the previous images again.
@kishankanugula if you want to keep the selected files you can add the selected files to another scope variable and have your preivew to show files from that scope variable instead of the one that is attached to the file input.
@danialfarid Thanks for your answer. I am already doing the same.Its not neat so thght there is a better way of doing it through configurations.
Fixed #783 #764 #777 #766 #763 #761 #721 #687 #650 #710 #784 #768 #789
Since version 5.0,0 you can use ngf-keep.
You can play with ngf-reset-on-click and ngf-reset-model-on-click since version 5.0,0
but make sure you test on different browsers.
@danialfarid : Thank you for the fix.