-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Model is being reset when the "click to select" area is clicked #761
Comments
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. |
@kishankanugula @papaiatis |
@danialfarid : Thank you for the fix. |
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?
The text was updated successfully, but these errors were encountered: