Allow input in select in HTML parser
- Category
- DOM
- Type
- New or changed feature
- Status
- Proposed (Chrome Proposed)
- Intent stage
- None
Summary
The HTML parser currently has a behavior where parsing an input tag will close any open ancestor select tag, preventing input elements from being used inside select elements. This is blocking us from working on the filterable select feature, which needs support for nesting input elements inside select. Some sites have accidentally relied on this parser behavior, so I have done outreach to migrate sites by adding the missing select end tag, which is a very simple fix. Existing usage can be seen in these two use counters: https://chromestatus.com/metrics/feature/timeline/popularity/5546 https://chromestatus.com/metrics/feature/timeline/popularity/5547
Motivation
After spending a fair amount of time considering alternatives like using an attribute on the select element or making the input and select elements be siblings, we decided that it would still be best to change the parser and allow nesting input in select.
Standards & signals
- Specification: https://github.com/whatwg/html/pull/13243
- Firefox: Positive
- Safari: No signal
- Web developers: No signals
- Tracking bug: https://issues.chromium.org/issues/396300371
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=html%2Fsemantics%2Fforms%2Fthe-select-element%2Fcustomizable-select%2Fselect-input-parsing
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Allow%20input%20in%20select%20in%20HTML%20parser
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Allow%20input%20in%20select%20in%20HTML%20parser
- Baseline status: https://webstatus.dev/?q=Allow%20input%20in%20select%20in%20HTML%20parser