Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#11983 closed bug (cantfix)

Inconsistent change event on file inputs on IE

Reported by: ( axl ) ( dot ) ( ayco ) ( at ) ( gmail ) ( dot ) ( com ) Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: ie6 ie7 Cc:
Blocked by: Blocking:


Hi guys.

I'm working with jQuery 1.7.2 and its wonderful event binding methods, and I came across a bug.


First of all we assign a change event to an input type=file (with the on method, delegation way). Then if I open the file dialog and select a file the change event triggers the right way. But if I trigger the click for the input, the file dialog opens but no change event is fired.

THIS ONLY HAPPENS ON IE7/8 Could not test on IE6 Works ok on IE9 Works ok on Chrome Works ok on FF 13 When I tested on FF 3.6 I found that the .click() didn't open the file dialog, so it may be another bug there...


Change History (5)

comment:1 Changed 10 years ago by ( axl ) ( dot ) ( ayco ) ( at ) ( gmail ) ( dot ) ( com )

I discovered that this only happens when I open the input type=file with the jQuery .click() method, not with the browser .click().

I updated the test case : http://jsfiddle.net/t9qrQ/4/

You can take a look at my other bug submission: http://bugs.jquery.com/ticket/11991

Both are about not perfect behavior of the jQuery .click() method, but remember that this ticket isonly related to IE 7/8, and my other ticket is about all browsers.

comment:2 Changed 10 years ago by ( axl ) ( dot ) ( ayco ) ( at ) ( gmail ) ( dot ) ( com )

I discovered which is the behavior of IE more concisely and I'm freaking...

If I click the input type=file with my mouse, the change event begins working, later if I do browser .click() or jquery .click() the change event keeps working ok.

If I begin with browser .click() or jquery .click() the change event won't fire. If then I click with the mouse the change event gets activated, and if then I do browser .click() or jquery .click() (AFTER CLICKING ALMOST ONE TIME WITH THE MOUSE) the change event keeps working.


  • input type=file onChange events won't work on IE7/8 until the user manually clicks the input with his mouse almost once, javascript virtual clicks won't mind.
  • this is obvioulsy a bug on IE7/8, so:
    • this shouldn't then be considered a bug submission, but a feature request
    • could jQuery developers create a workaround for this IE bug? I'm thinking about that at this time and I can't imagine how a javascript library could fix that implementation failure.

In my case, I fixed my web app by coding a conditional event: ($.browser.msie&&parseInt($.browser.version)<9)? "click": "change" var callback = function(){ /* true code here */} ($.browser.msie&&parseInt($.browser.version)<9)? setTimeout(callback, 0): callback(); but this isn't unacceptable for the core code...

Any ideas?

comment:3 Changed 10 years ago by dmethvin

Resolution: cantfix
Status: newclosed

There's really no way to fix or fake this. IE doesn't provide the information we need. As you said in the last comment there may be ways for app code to work around the issue, but they're not sufficiently general or consistent that we could include them into core.

comment:4 Changed 10 years ago by dmethvin

Keywords: ie6 ie7 added

comment:5 Changed 10 years ago by ( axl ) ( dot ) ( ayco ) ( at ) ( gmail ) ( dot ) ( com )

I suggest adding keywords IE8, and perhaps input file and change.

I wanna add that I read somewhere that the change event on input type files on IE can be replaced by "onPropertyChange", but I couldn't get it to work. could you be intrested in trying it? Maybe if works can suit the consistency requirements for core code, but just a suggestion. Maybe you have already tried that.

Best regards.

Note: See TracTickets for help on using tickets.