Bug 187084

Summary: `change` event for input[type=file] does not fire when different file with same name is selected
Product: WebKit Reporter: Mariko Kosaka <mariko.kosaka>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, ahmad.saleem792, akeerthi, ap, bfulgham, commit-queue, d, mparmaksiz54, rniwa, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Mac   
OS: macOS 10.13   
See Also: https://bugs.webkit.org/show_bug.cgi?id=227799
Bug Depends on: 246158    
Bug Blocks: 246143    

Mariko Kosaka
Reported 2018-06-26 22:40:59 PDT
https://codepen.io/anon/pen/eKPJda?editors=1010 Steps to reproduce: 1. [input]select file1 on <input type="file"> => change event is fired 2. [input]select file1 again => change event is NOT fired 3. Delete the file1, rename file2 to same name as file2 4. [input]select file2 (same file name as file1) => change event is NOT fired video : https://youtu.be/hrt6ll73kNk Expected: Change event is fired every-time user select a file on prompt. Regardless of filename or even when same file is selected twice.
Attachments
Mariko Kosaka
Comment 1 2018-06-27 10:41:14 PDT
Typo on reproduce instruction: 3. Delete the file1, rename file2 to same name as *file1*
Lucas Forschler
Comment 2 2019-02-06 09:19:08 PST
Mass move bugs into the DOM component.
Domenic Denicola
Comment 3 2021-07-08 09:44:46 PDT
Ahmad Saleem
Comment 4 2022-08-09 13:34:06 PDT
I am able to reproduce this bug in Safari 15.6 on macOS 12.5 and when selecting same file again, there is no "change event", it is only fired when I select another file. It is matching with Chrome Canary 106 but differs from Firefox Nightly 105, which fires change event every time I select file even if it is same file. Just wanted to share updated results. Thanks! Also I think, this might be same as 227799 but just going to update this. Thanks!
Radar WebKit Bug Importer
Comment 5 2022-08-10 10:59:56 PDT
Aditya Keerthi
Comment 6 2022-08-10 15:13:25 PDT
https://bugs.webkit.org/show_bug.cgi?id=227799 is related, and is a nicer way of handling (2), where the same file and filename are selected. I think we should still fire a change event for (4) though, when the name is changed.
Richard Robinson
Comment 7 2022-10-03 14:46:32 PDT
EWS
Comment 8 2022-10-05 22:58:42 PDT
Committed 255209@main (5374937e8566): <https://commits.webkit.org/255209@main> Reviewed commits have been landed. Closing PR #4943 and removing active labels.
WebKit Commit Bot
Comment 9 2022-10-06 08:38:56 PDT
Re-opened since this is blocked by bug 246158
Richard Robinson
Comment 10 2022-10-06 09:40:39 PDT
EWS
Comment 11 2022-10-07 15:22:13 PDT
Committed 255297@main (14b28281c8d0): <https://commits.webkit.org/255297@main> Reviewed commits have been landed. Closing PR #5089 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.