Onchange-event not triggered when resetting non-focused date-input-field (same for time-input-field)
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: gabriel, Assigned: mbrodesser-Igalia)
References
(Blocks 2 open bugs)
Details
Attachments
(2 files, 2 obsolete files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6 Steps to reproduce: Clicked on the "x"-button of a date-input-field (that was not focused) to reset the date. Clicked on the "x"-button of a time-input-field (that was not focused) to reset the date. Both works fine if the field has focus (blue border). Actual results: The onchange-event is NOT fired. Expected results: The onchange-event should have been fired.
Hi Gabriel, thanks for reporting the issue. What websites were you visiting where you can replicate this issue?
Reporter | ||
Comment 2•6 years ago
|
||
no website needed. you can replicate it with every <input type="date" onchange="alert('changed');" /> Gabriel
Comment 3•6 years ago
|
||
I see an alert when following the steps to reproduce on data:text/html;charset=utf-8,<input type="date" onchange="alert('changed');" />
Reporter | ||
Comment 4•6 years ago
|
||
With what version on what system? Thank you (In reply to Henri Sivonen (:hsivonen) from comment #3) > I see an alert when following the steps to reproduce on > data:text/html;charset=utf-8,<input type="date" onchange="alert('changed');" > />
Comment 5•6 years ago
|
||
(In reply to Gabriel Gritsch from comment #4) > With what version on what system? 61.0a1 (2018-04-27) 64-bit on Ubuntu 16.04.
Reporter | ||
Comment 6•6 years ago
|
||
Hi, its still reproducible, but I found out when it is reproducible with version 60.0: it does NOT work if a value is preset when the page is loaded and you click on the "reset"-button. You can test it with the code on that page: https://www.gritsch-soft.com/ff/date.html I have also created a short screencast to show the error: https://ufile.io/itzau (link valid for 30 days).
Reporter | ||
Updated•6 years ago
|
Comment 7•6 years ago
|
||
I cannot reproduce this on Nightly 62
Reporter | ||
Comment 8•6 years ago
|
||
Sorry but I have to re-open it. It is still reproducible on Nightly 62.0a1 (2018-05-26) on macOS 10.13.4 (not tested on other Systems).
Reporter | ||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 9•6 years ago
|
||
I just camed here because i encoutered the exact same issue. I'll attach this issue a html test case. The input[date] have a default value and as you can see in the console if you clic the reset buton right after the page load the onChange event is not triggered. However if the input get the focus and then the reset buton trigger the onChange event. The expected behavior is that no matter what the input have the focus or not if his value change then the onChange event should be triggered.
Comment 10•6 years ago
|
||
Comment 11•5 years ago
|
||
Can confirm i run into the same problem. The Bug only appers 1. On a fresh request (because F5 and Strg+R let the predefined value disappear) 2. if the first interaction with the date field is the click on the X Icon (Once the date field get the focus, it works) 3. the value param is set (If no value is set the X Icon does not appear) Test Code: <input type="date" onchange="alert('changed')" value="2018-09-09" /> Environment: Firefox Quantum 62.0.3 (64-Bit), Ubuntu 18.04
Comment 12•5 years ago
|
||
I can reproduce this bug on Firefox Quantum 64b4 (64bit), Windows 10.
Updated•5 years ago
|
Updated•5 years ago
|
Reporter | ||
Comment 13•5 years ago
|
||
Still no fix?
Reporter | ||
Updated•5 years ago
|
Comment 16•5 years ago
|
||
this issue is not resolved from almost an year.😤
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 17•5 years ago
|
||
In order to trigger the 'onchange' event when resetting the 'date' or
'time' html input elements.
This review is only basis for discussion in order to determine if the
fix goes in the correct direction.
Assignee | ||
Comment 18•5 years ago
|
||
:smaug: can you please have a look at the attached review (https://bugzilla.mozilla.org/attachment.cgi?id=9051306). It is just a first version, reflecting my current understanding of the code. I'm interested if the fix is going in the correct direction. Any feedback is appreciated.
Comment 19•5 years ago
|
||
Took a bit time to figure out that stuff, but looks reasonable.
Store the initial value early so that we can compare later when value is set to "";
Assignee | ||
Comment 20•5 years ago
|
||
In order to trigger the 'onchange' event when resetting the 'date' or
'time' html input elements.
Updated•5 years ago
|
Assignee | ||
Comment 21•5 years ago
|
||
In order to trigger the 'onchange' event when resetting the 'date' or
'time' html input elements.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 22•5 years ago
|
||
The try run (https://treeherder.mozilla.org/#/jobs?repo=try&revision=fb92b88e86520088bd63f140da4f19d0afcf0849,) for the attached patch looks OK. It contains a few failures, but they are not related to this change.
Assignee | ||
Updated•5 years ago
|
Comment 23•5 years ago
|
||
Pushed by rmaries@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/98343ff41322
set default value for 'mFocusedValue' for the html input elements 'date' and 'time'. r=smaug
Comment 24•5 years ago
|
||
bugherder |
Description
•