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

Ajax sorting and deleting is messing up the JavaScript object of the file input. #1152

Closed
13 of 18 tasks
AlexOlteanuCodinbit opened this issue Jan 10, 2018 · 5 comments
Closed
13 of 18 tasks
Labels

Comments

@AlexOlteanuCodinbit
Copy link

Prerequisites

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • The issue still exists against the latest master branch of bootstrap-fileinput.
  • This is not an usage question. I confirm having read the plugin documentation and demos.
  • This is not a general programming / coding question. (Those should be directed to the webtips Q & A forum).
  • I have attempted to find the simplest possible steps to reproduce the issue.

Steps to reproduce the issue

  1. Upload files using filebatchselected event.
  2. Delete one or more after uploaded is completed.
  3. Sort files.

Expected behavior and actual behavior

When I follow those steps, sometimes after deleted a file, and i want to sort the gallery, the object that is returned by the event $('.file-loading').on('filesorted', function(event, params) { ... } it's broken. The file that was deleted does not appear in the preview, but it is present in object, or i have files in the preview that do not appear in the object, or i have null item in object.

I need the correct object, according with the preview, to call sort method on my server. To understand better the issue i make a video with this problem using your demo.

In my case after automatically uploaded the files, I can sort them, delete them, but if I try to delete a file and then sort them, sometimes the object is broken. I can not identify a clear scenario when this problem happens and when it does not happen.

Environment

  • Yii2

Browsers

  • Google Chrome
  • Mozilla Firefox
  • Internet Explorer
  • Safari

Operating System

  • Windows
  • Mac OS X
  • Linux
  • Mobile

Libraries

  • jQuery version:
  • bootstrap-fileinput version:

Isolating the problem

  • This bug happens on the plugin demos page
  • The bug happens consistently across all tested browsers
  • This bug happens when using bootstrap-fileinput without other plugins
  • I can reproduce this bug in a jsbin
@kartik-v
Copy link
Owner

kartik-v commented Jan 10, 2018

Can you check and confirm if this solves it? Will reopen if needed.

@AlexOlteanuCodinbit
Copy link
Author

Thanks for quick reply.

Unfortunately the bug still exist.

I made another video on my local project. After delete a file the object returned by the event $('.file-loading').on('filesorted', function(event, params) { ... } it's broken.

@kartik-v
Copy link
Owner

You can check now.

@AlexOlteanuCodinbit
Copy link
Author

Still happening. This is video made after update.

I do not understand why the object is corrupted after the sorting and the removal action.
If I just sort or just remove a file, everything it's ok, but when i do it simultaneously, the object it's broken.

@kartik-v
Copy link
Owner

kartik-v commented Jan 12, 2018

Sorry, cannot reproduce your issue. You probably do not have the latest plugin JS code on your test app. You can try and cross check with ajax demo 6 or ajax demo 5 where the scenario works fine.

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

No branches or pull requests

2 participants