<?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>195836</bug_id>
          
          <creation_ts>2019-03-15 17:01:32 -0700</creation_ts>
          <short_desc>&lt;label&gt; with nested &lt;input&gt;s always focuses the first input when clicking other inputs</short_desc>
          <delta_ts>2023-05-25 11:38:44 -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 11</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.14</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></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="JC Franco">jfranco</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>cdumez</cc>
    
    <cc>dpaddock</cc>
    
    <cc>karlcow</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>webkit.org</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1517293</commentid>
    <comment_count>0</comment_count>
      <attachid>364882</attachid>
    <who name="JC Franco">jfranco</who>
    <bug_when>2019-03-15 17:01:32 -0700</bug_when>
    <thetext>Created attachment 364882
Simple HTML that renders a form with a label with multiple inputs

Test case (attached too): https://codepen.io/jcfranco-the-scripter/pen/NJYQem?editors=1000

To reproduce, click on the time input and see how the date field gets focus.

Tested on: 

Safari - Version 12.0.1 (14606.2.104.1.1)
Safari Tech Preview - Release 77 (Safari 12.2, WebKit 14608.1.7.3)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1517454</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-03-16 12:07:31 -0700</bug_when>
    <thetext>&lt;rdar://problem/48955176&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1638071</commentid>
    <comment_count>2</comment_count>
    <who name="Curtis Wilcox">webkit.org</who>
    <bug_when>2020-04-06 05:30:58 -0700</bug_when>
    <thetext>Multiple inputs as children of a single label element is not valid HTML. Run the test case through https://validator.w3.org/nu/ and one of the errors will be &quot;The label element may contain at most one button, input, meter, output, progress, select, or textarea descendant.&quot;

The WHATWG spec document doesn&apos;t describe only one such child element as valid, it says &quot;If the for attribute is not specified, but the label element has a labelable element descendant, then the first such descendant in tree order is the label element&apos;s labeled control.&quot; That matches the behavior you describe.

https://html.spec.whatwg.org/multipage/forms.html#the-label-element</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1957969</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-05-25 11:38:44 -0700</bug_when>
    <thetext>I am not able to reproduce this bug using attached testcase and all browsers allow you to place caret in &apos;time&apos; field without any jumpy etc.

Safari 16.5, STP170, Chrome Canary 115 and Firefox Nightly 115 have same behavior.

Marking this as &apos;RESOLVED CONFIGURATION CHANGED&quot;.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>364882</attachid>
            <date>2019-03-15 17:01:32 -0700</date>
            <delta_ts>2019-03-15 17:01:32 -0700</delta_ts>
            <desc>Simple HTML that renders a form with a label with multiple inputs</desc>
            <filename>safari-focus-issue.html</filename>
            <type>text/html</type>
            <size>560</size>
            <attacher name="JC Franco">jfranco</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KICA8bWV0YSBjaGFyc2V0PSJ1dGYtOCIgLz4K
ICA8bWV0YSBuYW1lPSJ2aWV3cG9ydCIgY29udGVudD0iaW5pdGlhbC1zY2FsZT0xLG1heGltdW0t
c2NhbGU9MSx1c2VyLXNjYWxhYmxlPW5vIiAvPgogIDx0aXRsZT5bU2FmYXJpXSBGb2N1cyBpc3N1
ZTwvdGl0bGU+CjwvaGVhZD4KCjxib2R5PgogIDxmb3JtPgogICAgPGxhYmVsCiAgICA+Q29tcG9z
aXRlIEZpZWxkIChkYXRlIGlucHV0IGlzIGZvY3VzZWQgd2hlbiB0aW1lIGlucHV0IGlzIGNsaWNr
ZWQpCiAgICAgIDxkaXY+CiAgICAgICAgPGRpdj4KICAgICAgICAgIDxpbnB1dCB0eXBlPSJ0ZXh0
IiAvPgogICAgICAgICAgPGRpdiBpZD0iZGF0ZSI+MTIvMzEvMTk2OTwvZGl2PgogICAgICAgIDwv
ZGl2PgogICAgICAgIDxkaXY+CiAgICAgICAgICA8aW5wdXQgdHlwZT0idGV4dCIgLz4KICAgICAg
ICAgIDxkaXYgaWQ9InRpbWUiPjQ6MDA6MDAgUE08L2Rpdj4KICAgICAgICA8L2Rpdj4KICAgICAg
PC9kaXY+CiAgICA8L2xhYmVsPgogIDwvZm9ybT4KPC9ib2R5Pgo8L2h0bWw+Cgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>