Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Firefox <button> with ng-file-select doesn't work #298

Closed
bayne opened this issue Aug 13, 2014 · 6 comments
Closed

Firefox <button> with ng-file-select doesn't work #298

bayne opened this issue Aug 13, 2014 · 6 comments

Comments

@bayne
Copy link

bayne commented Aug 13, 2014

http://plnkr.co/edit/XqtcPMOd4mYxc2vujYaL

  <body ng-app="TestApp">
    <ul>
      <li><div ng-file-select>Click</div></li>
      <li><button ng-file-select>Click</button></li>
    </ul>
    <script>
      angular.module('TestApp', ['angularFileUpload']);
    </script>
  </body>

In Chrome 36.0.1985.125, both work
In Firefox 31.0, only the <div> works

My workaround is to wrap the button with a span and attaching the directive to that.

@danialfarid
Copy link
Owner

The approach I am using is to add an input file inside the element, so the element needs to be able to contain an input file which is not the case for button element.
I will add a check for permissible elements to the next version. Thanks for reporting.

@Dirbaio
Copy link

Dirbaio commented Aug 17, 2014

+1. I just got bit by this too.

Maybe you could have the directive wrap the button inside a span and add the file input to the span automatically?

@kz26
Copy link

kz26 commented Sep 2, 2014

+1, also ran into this issue.

danialfarid pushed a commit that referenced this issue Sep 14, 2014
danialfarid pushed a commit that referenced this issue Sep 14, 2014
@spooky
Copy link

spooky commented Sep 22, 2014

issue still there after the commit 6ea5480.
I'm using

<h1>
    Foo
    <button type="button" class="btn btn-default btn-sm" title="import from csv" ng-file-select="uploadCsv($files)">
        <span class="glyphicon glyphicon-file"></span>
    </button>
</h1>

the file selection dialog doesn't show up after click. Works when I change the element though.

@kristian-puccio
Copy link

This needs to be re-opened.

Cheers

@danialfarid danialfarid reopened this Sep 25, 2014
danialfarid pushed a commit that referenced this issue Sep 26, 2014
@danialfarid
Copy link
Owner

Should be fixed at version 1.6.10

danialfarid pushed a commit that referenced this issue Sep 26, 2014
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants