Skip to content
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

OverwriteInitial + ClearStack not working #900

Closed
blacko2017 opened this issue Mar 9, 2017 · 2 comments
Closed

OverwriteInitial + ClearStack not working #900

blacko2017 opened this issue Mar 9, 2017 · 2 comments

Comments

@blacko2017
Copy link

blacko2017 commented Mar 9, 2017

@kartik-v Now there is a new problem. If you click Multiple upload button on a non-multiple file, the overwriteInitial does not work.

If you try getFileStack, it shows the correct list, 1 file, but in the preview there are 2 or more.

Steps to reproduce the issue

  1. You have an image for initialPreview and you set overwriteInitial true;
  2. You select another image, the initialPreview disappears;
  3. You press Upload and the first initial preview appears again.

Expected behavior and actual behavior

Only the new uploaded image should appear, but it shows all old files, not replacing.

@blacko2017
Copy link
Author

screenshot 2017-03-09 14 08 56

After changing the image the third time, it shows all old previews.

@blacko2017
Copy link
Author

blacko2017 commented Mar 9, 2017

Ok I found that ClearStack removes only not-uploaded files, so it is working.

About the not-overwriting problem, I found that in my case the problem is the command in row 1663:
self.overwriteInitial = false;

It disables overwriteInitial after first upload. But in the case of a single upload, it should be ALWAYS overwrote. So it's not an issue/bug but it should be introduced in my opinion!

## Edit ##

Finally found a solution:
if(self.$element.attr('multiple')) self.overwriteInitial = false;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants