Alternative implementation · Prototype available
Native radio validation
A focused reproduction of required radio-group submission, native constraint validation, and browser focus placement.
Working demonstration
Evaluate this experiment Open the registered demonstration
- Radio validation — baseline and experimental fixtures available.
- Form controls — baseline and experimental fixtures available.
The evaluation workspace does not mirror keyboard input. Open either implementation independently for keyboard and assistive-technology testing.
Proposal and context
Status: Prototype. Automated evidence may exist; human review is pending.
Category: Alternative implementation
Baseline: USWDS v3.14.0
Proposal: A focused reproduction of required radio-group validation and focus placement.
Why this exists
USWDS issue #6068 reports that checkbox and radio controls do not support Voice Control. Issue #6080 reproduced a related native radio validation problem and was consolidated into #6068 rather than fixed.
This experiment does not claim to fix positioning or Voice Control. It records what the browser actually does with a required group, so a future proposal has a reproducible baseline.
What stable USWDS provides
USWDS provides radio markup, visually hidden native inputs, and a label that draws the visible control. The native input remains focusable and participates in form validation.
What is proposed
A required radio group with:
- a fieldset and legend;
- two native radio inputs with
required; - a visible hint that the group is required;
- no redundant
aria-requiredor customrole="radiogroup"; - a submit button and a local status message;
- a reset button.
What changed in the lab
This is a new fixture (radio-validation) with baseline and experimental variants. The experimental variant adds the theme layer; the validation behavior is native in both. There is no custom validation script.
Evidence status
Automated tests record document.activeElement after an invalid submit, native validity, keyboard selection, and the valid submission path. Browser differences are recorded rather than normalized away. Voice Control remains untested by a person.
Known limitations
- Native validation bubbles are browser-controlled and vary by browser and language.
- Focus placement after invalid submission may differ between Chromium and Firefox; the test records the actual result.
- The lab has not tested Voice Control, Dragon, or a real screen reader.
- The fixture does not fix the upstream radio positioning issue.
Implementation guidance
Markup
<form id="radio-validation-form" data-local-validation data-status-target="radio-validation-status">
<fieldset>
<legend>How should we contact you? <span class="fixture-required">(required)</span></legend>
<p id="contact-hint">Choose one option. The browser will block an empty submission.</p>
<div class="usa-radio">
<input class="usa-radio__input" id="contact-email" name="contact" value="email" type="radio" required>
<label class="usa-radio__label" for="contact-email">Email</label>
</div>
<div class="usa-radio">
<input class="usa-radio__input" id="contact-phone" name="contact" value="phone" type="radio" required>
<label class="usa-radio__label" for="contact-phone">Phone call</label>
</div>
</fieldset>
<button type="submit">Continue</button>
<button type="reset">Clear response</button>
</form>
<p id="radio-validation-status" role="status" aria-live="polite"></p>
Behavior
The form uses native constraint validation. site/assets/fixture.js attaches a local submit handler only to show a status message when the form is valid; it does not replace the browser's invalid-submission behavior. No data is sent.
Do not add aria-required to native required inputs. Do not add role="radiogroup": the fieldset and legend already provide the group name and relationship.
What the browser exposes
- The fieldset/legend relationship.
- A group of radio inputs with the same
name. requiredon each input.- Native
:invalidmatching after a failed submission. - Focus on the first invalid radio in tested Chromium; record Firefox separately.
How to test
- Open the fixture with JavaScript enabled.
- Press Tab to the first radio; use arrow keys and Space.
- Submit with no selection; record
document.activeElementandform.checkValidity(). - Select an option with the keyboard and submit; verify the local status.
- Reset and confirm the status clears.
- Repeat with
?theme=darkto check the radio surface and focus ring.
What a real contribution would need
- Reproduce the Voice Control issue with the named speech tool and operating system.
- Compare native input positioning with possible alternatives.
- Record browser-specific focus and validation behavior.
- Propose the smallest upstream change, with regression tests.
Known gaps
- No real Voice Control session.
- No real screen-reader session.
- The browser's validation bubble cannot be inspected programmatically.
Evidence and limitations
5 of 5 routes collected. Human review pending.
Open the evidence index for transcripts, screenshots, axe observations, and coverage gaps.
Automated evidence is not human approval. The decision record remains authoritative.
Related USWDS history
- #6068 Checkbox and radio Voice Control (motivation)
- #6080 Radio native validation (historical-consolidation)
Experiment files
AI assistance disclosed by the contributor: issue research, initial implementation, test scaffolding, documentation drafting. A human reviewer must assess the evidence before any upstream proposal.