<input type="checkbox" defaultindeterminate>
- Category
- Miscellaneous
- Type
- New or changed feature
- Status
- Proposed (Chrome Proposed)
- Intent stage
- None
Summary
Adds a "defaultindeterminate" attribute to <input type="checkbox"> to allow specifying indeterminateness statically. Today, the IDL attribute must be invoked via JavaScript, which blocks static HTML generators and server-side rendering pipelines from being able to make easy use of indeterminate checkboxes.
Motivation
Checkboxes today cannot be statically defined to have an indeterminate state, and can only reach that state post-creation through JavaScript invoking a property setter. It is possible to represent indeterminateness to Assistive Technologies (ATs) via the aria-checked=mixed content attribute value, but that only applies to Assistive Technologies. The discussion in whatwg/html#6578 identified several situations where this gap is made apparent today, and adding this attribute will allow filling those gaps.
Standards & signals
- Specification: https://github.com/whatwg/html/pull/13224
- Firefox: No signal
- Safari: No signal
- Web developers: No signals
- Tracking bug: https://issues.chromium.org/issues/584737034
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=input-type-checkbox-defaultindeterminate
- 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+%3Cinput%20type%3D%22checkbox%22%20defaultindeterminate%3E
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=%3Cinput%20type%3D%22checkbox%22%20defaultindeterminate%3E
- Baseline status: https://webstatus.dev/?q=%3Cinput%20type%3D%22checkbox%22%20defaultindeterminate%3E
Explainers: https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/DefaultIndeterminate/explainer.md