jasny / bootstrap

The missing components for your favorite front-end framework.
https://www.jasny.net/bootstrap/
Apache License 2.0
2.68k stars 495 forks source link

Button not triggering file upload in Firefox / IE #190

Closed ryanbbowers closed 10 years ago

ryanbbowers commented 10 years ago

Previously had Jasny Bootstrap file upload working fine in all browsers in Rails 4.0 app. Just upgraded from Bootstrap 3.0 to 3.1. Also just upgraded Jasny Bootstrap to 3.1 (and changed all the "fileupload" to "fileinput" as well in views). Works fine in Chrome, but in Firefox and IE now, however, the "select" button is not triggering the file upload window. You can actually click on the label and that triggers the file upload, but not the button itself. Here is my code (using simple_form):

<%= f.input :spec, :label => raw("<i class=\"glyphicon glyphicon-paperclip\"></i> Upload Spec">) do %>
</br><div class="fileinput fileinput-new" data-provides="fileinput">
<span class="btn btn-info btn-file"><span class="fileinput-new">Select file</span><span class="fileinput-exists">Change</span><%= f.file_field :spec></span>
<span class="fileinput-filename"></span>
<a href="#" class="close fileinput-exists" data-dismiss="fileinput" style="float: none">&times;</a>
</div>
<% end %>
ryanbbowers commented 10 years ago

Looked into it more - the problem turns out to be the same as issue #157. The transform: translate(-300px, 0) scale(4); is causing the position of the file input box to appear left and not overlapping the button. Was there any formal resolution to this issue?

jasny commented 10 years ago

K, High prio. I'll fix it soon.

ryanbbowers commented 10 years ago

For the time being, I edited jasny-bootstrap.min.css as follows:

.btn-file > input { //transform: translate(0px, 0) scale(4);

This has it working properly in all browsers (using both the basic file upload and the image preview version).

jasny commented 10 years ago

This is the same issue as #157