Bug 66907 - File input element does not fire onchange event when the selection changes a second time
Summary: File input element does not fire onchange event when the selection changes a ...
Status: RESOLVED DUPLICATE of bug 63929
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-24 17:22 PDT by Mike.Fellows
Modified: 2011-09-07 22:33 PDT (History)
3 users (show)

See Also:


Attachments
A reduced test case for displaying an input of type file's onchange event behaviour (2.21 KB, text/html)
2011-08-24 17:22 PDT, Mike.Fellows
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike.Fellows 2011-08-24 17:22:42 PDT
Created attachment 105101 [details]
A reduced test case for displaying an input of type file's onchange event behaviour

If a file or set of files is selected via an input element of type file the onchange event will be fired for the first selection.  If a new set of files is selected, and the first file in the new file list is the same as the first file in the old file list the onchange event will not be fired.  Any additional information displayed by the input element about how many files are selected will change regardless of whether or not the onchange event is fired.  If the second selection does not have the same first file as the first selection the onchange event will fire as expected.


A step by step example for reproducing the problem:

1. Page is loaded, the Choose File button is clicked and the files selected are "1.jpg, 2.jpg".  The input element lists "2 files" next to the Choose File button and the onchange event will be fired as expected.

2. The Choose File button is clicked a second time and the files selected are "1.jpg, 2.jpg, 3.jpg, 4.jpg".  The input element now changes to list "4 files" next to the Choose File button but the onchange event will not be fired.


I've attached a reduced test case to the issue the will display this behaviour.

I've tested this in the following browsers:

Google Chrome Linux version 13.0.782.215, WebKit: 535.1 (branches/chromium/782@93192)
Google Chrome Windows version 13.0.782.215 WebKit: 535.1 (branches/chromium/782@93192)
Safari for Windows version 5.1 (7534.50) (WebKit: 534.50 according to the User Agent String)

I've seen the same behaviour in a Chrome v 12 browser as well so I think the issue has been around for awhile.


According to the current draft html5 spec the change event should fire when the file list is changed by user input:

http://www.w3.org/TR/html5/common-input-element-attributes.html#event-input-change
Comment 1 Shinya Kawanaka 2011-09-07 22:31:43 PDT
I couldn't repro this. I think this was fixed in r90438. See also https://bugs.webkit.org/show_bug.cgi?id=63929
Comment 2 Kent Tamura 2011-09-07 22:33:46 PDT

*** This bug has been marked as a duplicate of bug 63929 ***