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

Update required to fix IE10 double click issue? #33

Closed
Burkazoid opened this issue Mar 4, 2013 · 13 comments
Closed

Update required to fix IE10 double click issue? #33

Burkazoid opened this issue Mar 4, 2013 · 13 comments

Comments

@Burkazoid
Copy link

See blueimp/jQuery-File-Upload#1611

Symptoms: Clicking the add file button requires a double click in IE 10.

This issue is occurring for me when using this gem, but seems fixed in the main jquery-file-upload repo. Perhaps this gem needs updated?

Thanks

@danko-master
Copy link

I agree with you, too, doing a project under IE - does not work. Author, please update gem.

@danko-master
Copy link

Solved the problem by redefining click for IE

if (navigator.userAgent.indexOf("MSIE") > 0)
$("#upload_photo").mousedown ->
$(this).trigger('click')

@lypanov
Copy link

lypanov commented Jul 17, 2013

@danko-master Thank you!!! Your tip saved me a ton of time.

@danko-master
Copy link

You are welcome!)

@nagyt234
Copy link

nagyt234 commented Aug 5, 2013

Thx for this patch. Only a small modification, because this patch causes troubles in IE8 and IE9: auto upload does not start.
The following code works on IE8 9 and 10 also (limited to run in IE10):

      if (navigator.userAgent.indexOf("MSIE 10") > 0) {
       $("#upload_upload").bind('mousedown',function(event) {
         $(this).trigger('click')
       });

@slopezm
Copy link

slopezm commented Aug 5, 2013

Thank you @danko-master and @nagyt234! For anyone having problems, just remember that you need to add the patch after you initialize the fileupload plugin.

@thimstr
Copy link

thimstr commented Sep 1, 2013

I don't understand where i have to put this patch.

@nagyt234
Copy link

nagyt234 commented Sep 2, 2013

Dear @thimstr, you are initializing somewhere the fileupload plugin in javascript in a "document ready" block, and you should use the patch after it, e.g. in jQuery environment:

<script type="text/javascript" charset="utf-8">
  $(function () {
      // Initialize the jQuery File Upload widget:
      $('#fileupload').fileupload(
        ...
      );

      ...

      if (navigator.userAgent.indexOf("MSIE 10") > 0) {
       $("#upload_upload").bind('mousedown',function(event) {
         $(this).trigger('click')
       });
      }
  });
</script>

Note that $("#upload_upload") refers to the upload button, where the 'mousedown' event is to be converted to 'click' event in the case of MSIE10. I.e. 'upload_upload' is the HTML id of the button. @danko-master provided the similar example bit written in coffee-script.

@thimstr
Copy link

thimstr commented Sep 12, 2013

it worked, thanks!

@elisadistefano
Copy link

Hi @nagyt234,

the patch to fix double click problem on IE10 causes the error "Script5: Access denied", that is thrown when calling data.submit(), in order to get the XHR object. Then, the upload request never starts.
If you bind the mousedown event on input button, you will always get the error above on IE10.

So, what i'm doing wrong? Can you help me, please?
Thanks in advance.

@LuisAndres
Copy link

I have the same error "Script5: Access denied", can help me?

@ahmadhussain
Copy link

This would be helpful for IE

$(function(){
if (navigator.userAgent.indexOf("MSIE") > 0) {
$("input[type=file]").live('mousedown',function(event) {$(this).trigger('click');});
}
});

@felixbuenemann
Copy link
Collaborator

Please open a new issue if this still happens with 0.4.2.

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

10 participants