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

Deleting one preview clears files from the input the widget is living in #1880

Open
6 of 18 tasks
Mikshul opened this issue Dec 18, 2024 · 0 comments
Open
6 of 18 tasks

Comments

@Mikshul
Copy link

Mikshul commented Dec 18, 2024

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.
  • I have included a failing test as a pull request (Optional).

Steps to reproduce the issue

  1. Add any number of pictures inside the input
  2. Delete any one of them
  3. Call $('#input-id-here')[0].files and see the empty FileList

Expected behavior and actual behavior

When I follow those steps, I see the empty FileList, all the items left are still visible inside the preview panel.

I was expecting to be able to continue to crop (I am using Jcrop) and manipulate the items, but because the FileList of the input is emptied, I cannot do that anymore.

On a side note, calling $('#input-id-here').fileinput('getFileStack') returns the list with the items left in the preview.

Environment

Browsers

  • Google Chrome
  • Mozilla Firefox
  • Internet Explorer
  • Safari

Operating System

  • Windows
  • Mac OS X
  • Linux
  • Mobile

Libraries

  • jQuery version: v3.2.1
  • bootstrap-fileinput version: v4.4.7

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
@Mikshul Mikshul changed the title Deleting one preview clears files from the input the widget is living Deleting one preview clears files from the input the widget is living in Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant