WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
223465
input[type=date] fires a change event before user can select a date if no initial value
https://bugs.webkit.org/show_bug.cgi?id=223465
Summary
input[type=date] fires a change event before user can select a date if no ini...
Bob Brown
Reported
2021-03-18 12:13:33 PDT
Steps to Reproduce Use this page:
https://jsfiddle.net/e8ngLvmp/
or build a page with input type=date and no value attribute: <input type="date" name="date1" id="date1"> Hook the change event: document.getElementById("date1").addEventListener("change",function() { alert('Change event signaled; value='+document.getElementById("date1").value); }); Load the page using an iPad running iOS 14.41 and Safari 14.4, then touch or tap the date input element. (Not tested with other Apple devices.) Expected behavior The alert is shown after the user has selected a date using the date picker and the alert displays the selected date. Actual behavior The change event is fired as soon as the input field is tapped, the alert displays the current date, and the date picker is not shown until the alert is dismissed. Regardless of the date selected in the date picker, the input element shows the current date. Notes: This failure occurs only in the case that the input element has no value attribute. The date picker is focused on the current date, which is the only reasonable thing to do, but the current date is also set as a value on the input element and the change event signaled. That is the error. This only happens when a page showing this behavior is initially loaded.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2021-03-25 12:14:14 PDT
<
rdar://problem/75847384
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug