<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>223465</bug_id>
          
          <creation_ts>2021-03-18 12:13:33 -0700</creation_ts>
          <short_desc>input[type=date] fires a change event before user can select a date if no initial value</short_desc>
          <delta_ts>2021-03-25 12:14:14 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Forms</component>
          <version>Safari 14</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 14</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>https://jsfiddle.net/e8ngLvmp/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Bob Brown">bugs</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>akeerthi</cc>
    
    <cc>cdumez</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1741321</commentid>
    <comment_count>0</comment_count>
    <who name="Bob Brown">bugs</who>
    <bug_when>2021-03-18 12:13:33 -0700</bug_when>
    <thetext>Steps to Reproduce
Use this page: https://jsfiddle.net/e8ngLvmp/ or build a page with input type=date and no value attribute: &lt;input type=&quot;date&quot; name=&quot;date1&quot; id=&quot;date1&quot;&gt;
Hook the change event:
document.getElementById(&quot;date1&quot;).addEventListener(&quot;change&quot;,function() {
	alert(&apos;Change event signaled; value=&apos;+document.getElementById(&quot;date1&quot;).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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1743859</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-03-25 12:14:14 -0700</bug_when>
    <thetext>&lt;rdar://problem/75847384&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>