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

form method 'reset' can't work well with none-empty preview #1033

Closed
davidhsing opened this issue Aug 8, 2017 · 0 comments
Closed

form method 'reset' can't work well with none-empty preview #1033

davidhsing opened this issue Aug 8, 2017 · 0 comments

Comments

@davidhsing
Copy link

Steps to reproduce the issue

  1. Setup a form with a 'file-loading' input and a reset button.
  2. Set the fileinput element with 'uploadUrl' option. (This will show a drop zone title like 'Drag files here...')
  3. Choose a picture whatever.
  4. Click the form's 'reset' button.

Expected behavior and actual behavior

When I follow those steps, I see...
The drop zone title has gone.

I was expecting...
It works well.

Environment

Browsers

  • [] Google Chrome

Operating System

  • [] Windows

Libraries

  • jQuery version: 2.1.4
  • bootstrap-fileinput version: 4.4.2

My Solution

The problem was caused by the 'bootstrap-fileinput.js' at line 3556 & 3557, which is
"
3556: self._setFileDropZoneTitle();
3557: self.clearStack();
"
Since the first function will check the "self.getFileStack().length > 0" condition, which will be always true, and it will be dealed with the next function of line 3557.
So, exchange the two lines, the fileinput works very well.

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