| Summary: | <label> with nested <input>s always focuses the first input when clicking other inputs | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | JC Franco <jfranco> | ||||
| Component: | Forms | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | RESOLVED CONFIGURATION CHANGED | ||||||
| Severity: | Normal | CC: | ahmad.saleem792, cdumez, dpaddock, karlcow, webkit-bug-importer, webkit.org, wenson_hsieh | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | Safari 11 | ||||||
| Hardware: | Mac | ||||||
| OS: | macOS 10.14 | ||||||
| Attachments: |
|
||||||
|
Description
JC Franco
2019-03-15 17:01:32 PDT
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 "The label element may contain at most one button, input, meter, output, progress, select, or textarea descendant." The WHATWG spec document doesn't describe only one such child element as valid, it says "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's labeled control." That matches the behavior you describe. https://html.spec.whatwg.org/multipage/forms.html#the-label-element I am not able to reproduce this bug using attached testcase and all browsers allow you to place caret in 'time' field without any jumpy etc. Safari 16.5, STP170, Chrome Canary 115 and Firefox Nightly 115 have same behavior. Marking this as 'RESOLVED CONFIGURATION CHANGED". |