Repository navigation
Description
Description
A CheckboxInput with isRequired is reported to screen readers as invalid while it is unticked, from the moment it renders, before the user has touched it or submitted the form. Nothing on screen looks invalid, because the visual invalid state follows status only. Anyone using a screen reader in Chromium hears "invalid entry" on every required checkbox of a fresh form.
Cause: the input sets native required and leaves aria-invalid unset unless status is an error (CheckboxInput.tsx#L575-L598). Chromium then derives the accessible invalid state from native constraint validation (:invalid), so an unchecked required box is exposed as invalid=true.
Switch already handles this: it sets aria-invalid={status?.type === 'error' ? true : isRequired ? false : undefined} with the comment "Chromium reports an unchecked native-required checkbox invalid before any interaction; the invalid state follows status instead" (Switch.tsx#L1033-L1037). CheckboxInput (and so the rows of a required CheckboxList) does not.
Expected: as with Switch, a required CheckboxInput exposes invalid only when status is an error (component:CheckboxInput FR6), while native required still blocks submission (FR7).
Reproduction
import {useState} from 'react';
import {CheckboxInput} from '@astryxdesign/core/CheckboxInput';
export function Repro() {
const [value, setValue] = useState(false);
return (
<form>
<CheckboxInput label="Accept the terms" value={value} onChange={setValue} isRequired />
</form>
);
}- Render the form in Chrome and open DevTools > Accessibility for the checkbox (or use a screen reader).
- Don't touch the checkbox.
Actual: the checkbox's computed properties include invalid: true; a screen reader announces it as invalid.
Expected: no invalid state until status says so, as a required Switch behaves.
The browser part reproduces with plain HTML: in Chromium 156 the accessibility tree of <input type="checkbox" required> reports invalid=true, and the same input with aria-invalid="false" reports invalid=false.
Workaround: none through props, since the component's own aria-invalid (set to undefined here) takes precedence over a caller's (FR8). An app that must avoid the announcement can leave out isRequired, check the box itself on submit and set an error status, at the cost of native validation and aria-required.
Astryx Version
@astryxdesign/[email protected], unchanged on main (497b48b)
Environment
Chromium 156 (headless, accessibility tree read over the DevTools protocol) for the native behaviour; the component cause from reading the source on main. Not checked in Firefox or Safari.
Activity
cixzhang commentedon Nov 13, 2026
(Posted by Cindy's agent.) A fix is up in #11619: a required
CheckboxInputnow exposes the invalid state only with an errorstatus(aria-invalid="false"otherwise), asSwitchdoes, so a fresh form no longer announces every required checkbox as invalid. Native validation still blocks an unchecked submission. Thanks for the clear report and the pointer to Switch.cixzhang commentedon Nov 14, 2026
(Posted by Cindy's agent.) #11619 has merged: a required
CheckboxInputnow exposes the invalid state only with an errorstatus, so screen readers no longer announce an untouched required checkbox as invalid. Native validation still blocks an unchecked submission. It ships in the next release.fix(CheckboxInput): a required box is not announced as invalid before…