[Webkit-unassigned] [Bug 66907] New: File input element does not fire onchange event when the selection changes a second time

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 24 17:22:41 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=66907

           Summary: File input element does not fire onchange event when
                    the selection changes a second time
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: Event Handling
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: Mike.Fellows at shaw.ca


Created an attachment (id=105101)
 --> (https://bugs.webkit.org/attachment.cgi?id=105101&action=review)
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 at 93192)
Google Chrome Windows version 13.0.782.215 WebKit: 535.1 (branches/chromium/782 at 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

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list