Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(CheckboxList, RadioList): a disabled list marks its group aria-disabled (#9633)

Cindy Zhang26f5e5d8cce1
diff --git a/.changeset/list-group-aria-disabled.md b/.changeset/list-group-aria-disabled.md
new file mode 100644
index 0000000000..ed1f46660a
--- /dev/null
+++ b/.changeset/list-group-aria-disabled.md
@@ -0,0 +1,7 @@
+---
+'@astryxdesign/core': patch
+---
+
+[fix] A disabled `CheckboxList` or `RadioList` now sets `aria-disabled="true"` on its group, so a screen reader announces the group itself as unavailable, not only each option, and the dimmed group label counts as the label of an inactive control.
+
+@cixzhang @duytbp
diff --git a/docs/specs/components/CheckboxList/CheckboxList.spec.md b/docs/specs/components/CheckboxList/CheckboxList.spec.md
index 5ab59ba60c..11a47cbce7 100644
--- a/docs/specs/components/CheckboxList/CheckboxList.spec.md
+++ b/docs/specs/components/CheckboxList/CheckboxList.spec.md
@@ -129,18 +129,18 @@ of `component:CheckboxListItem`.
## Behavioral and layout contract
-| ID | Invariant | Basis |
-| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
-| FR1 | The render MUST place CheckboxListItem children inside a List within a `role="group"` named by the group label through `aria-labelledby`; its `aria-describedby` MUST list any caller description, then the description, status message, and disabled-reason tooltip that are present, in that order. | shipped source; focused tests; WCAG 1.3.1 and 4.1.2 |
-| FR2 | The CheckboxList root MUST carry the current `checkbox-list` target. | shipped source and public docs |
-| FR4 | A status message MUST render through a detached FieldStatus after the list. | shipped source, focused tests, and the Chromium accessibility suite |
-| FR6 | With a `value` array, the group MUST provide membership to its items, call `onChange` with the next array an item proposes (`component:CheckboxListItem` FR4), and then run `changeAction` with the same array in a transition with an optimistic value. | shipped source and focused tests |
-| FR7 | The group MUST track every value whose `changeAction` is pending and expose it to its items, each of which renders busy (`component:CheckboxListItem` FR7); toggling another item MUST NOT clear an earlier pending value. Concurrent pending values settle together, after which every busy state clears. | shipped public `changeAction` promise; focused regression test; the Chromium accessibility suite |
-| FR9 | Group `isDisabled` MUST make every checkbox focusable-disabled through `aria-disabled` (`component:CheckboxInput` FR4) and refuse toggling. With `disabledMessage`, the reason tooltip opens on group hover and keyboard focus, and the reason MUST describe each focusable checkbox (`spec:AST-085` FR5, FR7). Implementation gap: the reason describes only the `role="group"`, so a focused checkbox is not described by it. | `spec:AST-085` FR1, FR7; shipped source, focused tests, and shared checkbox binding |
-| FR10 | Group `isReadOnly` MUST make every item in the group read-only (`component:CheckboxListItem` FR8 and FR10). | shipped source; shared checkbox binding; `spec:AST-011` read-only vocabulary |
-| FR13 | `density` MUST reach the List and its rows (the checkbox size follows `component:CheckboxListItem` FR11); `hasDividers` MUST separate rows without a divider after the last row; `width` MUST size the label, list, and status together. | shipped source, docs, and the Chromium accessibility suite |
-| FR14 | An error `status` with a message renders it (FR4), and an error `status` makes every checkbox `aria-invalid="true"`, so a screen reader announces the invalid state as each checkbox takes focus. Implementation gap: a status without a message renders nothing; its meaning is OQ3. | shipped source; `spec:AST-002/FR15` |
-| FR15 | Base props, including ARIA and `ref`, MUST reach the `role="group"`; a caller `aria-labelledby` joins the group label and a caller `aria-describedby` comes first. `container*` MUST reach the Field box where one renders (in a `horizontal-labels` FormLayout none renders, and `container*` has no effect and warns), and `control*` the group element; root `xstyle`, `className`, and `style` are not accepted. | `family:input-fields` FR10; `CheckboxList.fr10.test.tsx` |
+| ID | Invariant | Basis |
+| ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
+| FR1 | The render MUST place CheckboxListItem children inside a List within a `role="group"` named by the group label through `aria-labelledby`; its `aria-describedby` MUST list any caller description, then the description, status message, and disabled-reason tooltip that are present, in that order. | shipped source; focused tests; WCAG 1.3.1 and 4.1.2 |
+| FR2 | The CheckboxList root MUST carry the current `checkbox-list` target. | shipped source and public docs |
+| FR4 | A status message MUST render through a detached FieldStatus after the list. | shipped source, focused tests, and the Chromium accessibility suite |
+| FR6 | With a `value` array, the group MUST provide membership to its items, call `onChange` with the next array an item proposes (`component:CheckboxListItem` FR4), and then run `changeAction` with the same array in a transition with an optimistic value. | shipped source and focused tests |
+| FR7 | The group MUST track every value whose `changeAction` is pending and expose it to its items, each of which renders busy (`component:CheckboxListItem` FR7); toggling another item MUST NOT clear an earlier pending value. Concurrent pending values settle together, after which every busy state clears. | shipped public `changeAction` promise; focused regression test; the Chromium accessibility suite |
+| FR9 | Group `isDisabled` MUST make every checkbox focusable-disabled through `aria-disabled` (`component:CheckboxInput` FR4) and refuse toggling, and MUST set `aria-disabled="true"` on the `role="group"` element, as `component:ButtonGroup` FR1 does. With `disabledMessage`, the reason tooltip opens on group hover and keyboard focus, and the reason MUST describe each focusable checkbox (`spec:AST-085` FR5, FR7). Implementation gap: the reason describes only the `role="group"`, so a focused checkbox is not described by it. | `spec:AST-085` FR1, FR7; shipped source, focused tests, and shared checkbox binding |
+| FR10 | Group `isReadOnly` MUST make every item in the group read-only (`component:CheckboxListItem` FR8 and FR10). | shipped source; shared checkbox binding; `spec:AST-011` read-only vocabulary |
+| FR13 | `density` MUST reach the List and its rows (the checkbox size follows `component:CheckboxListItem` FR11); `hasDividers` MUST separate rows without a divider after the last row; `width` MUST size the label, list, and status together. | shipped source, docs, and the Chromium accessibility suite |
+| FR14 | An error `status` with a message renders it (FR4), and an error `status` makes every checkbox `aria-invalid="true"`, so a screen reader announces the invalid state as each checkbox takes focus. Implementation gap: a status without a message renders nothing; its meaning is OQ3. | shipped source; `spec:AST-002/FR15` |
+| FR15 | Base props, including ARIA and `ref`, MUST reach the `role="group"`; a caller `aria-labelledby` joins the group label and a caller `aria-describedby` comes first. `container*` MUST reach the Field box where one renders (in a `horizontal-labels` FormLayout none renders, and `container*` has no effect and warns), and `control*` the group element; root `xstyle`, `className`, and `style` are not accepted. | `family:input-fields` FR10; `CheckboxList.fr10.test.tsx` |
Per-option requirements are owned by `component:CheckboxListItem`
(`architecture:knowledge-contracts/INV2`).
@@ -288,17 +288,17 @@ row surface, but not a checked-row state (`component:CheckboxListItem` FR15).
## Verification map
-| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
-| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
-| FR1, AR1 | `CheckboxList.test.tsx` group-role, group-description, and disabledMessage cases | Named group; description plus status; disabled reason | A missing group name, or a description and status out of order, fails. Evidence gap: no test asserts the caller description first or the disabled reason last. | `audit:CheckboxList/accessibility` |
-| FR2, FR15 | `CheckboxList.test.tsx` ref and container case; `CheckboxList.fr10.test.tsx` | Standalone; `horizontal-labels` FormLayout | A ref off the group, `container*` off the Field box, or a base prop off the group fails. | `audit:CheckboxList/api` |
-| FR4, FR14 | `CheckboxList.test.tsx` error-status cases, including every checkbox's `aria-invalid`; `CheckboxListErrorStatus.a11y.chromium.spec.ts` | Error with message | A missing status message fails. Evidence gap: no test asserts the empty render without a message. | `audit:CheckboxList/accessibility` |
-| FR6, FR7 | `CheckboxList.test.tsx` add, remove, and pending cases; `CheckboxList.a11y.chromium.spec.ts` `pending-single`, `pending-concurrent`, and `pending-settled` cases | Add; remove; one and two pending values; settled | A wrong array, a cleared earlier pending value, or a busy state that outlives settlement fails. | `audit:CheckboxList/behavior` |
-| FR9, FR10, AR4 | `CheckboxList.test.tsx` group-disabled, disabledMessage, and read-only cases; shared checkbox bindings | Group disabled; with reason; read-only item | A lost tab stop, a toggle while disabled, or a read-only toggle fails. Evidence gap: no test asserts that a focused checkbox is not described by the reason. | `audit:CheckboxList/accessibility` |
-| FR13 | `CheckboxList.test.tsx` density cases; `CheckboxList.a11y.chromium.spec.ts` density, divider, 320-pixel, and RTL cases | Compact, balanced, spacious; dividers; narrow; RTL | A density, divider, overflow, or direction sensor fails. Evidence gap: no test asserts `width` sizing the label, list, and status together. | `audit:CheckboxList/layout` |
-| ORD1–ORD3, PR1 | ORD1 and ORD2 are covered by the FR6 and FR7 rows, ORD3 by the FR9 and FR10 rows. Evidence gap: no test asserts the absence of observers or global listeners | — | — | `audit:CheckboxList/behavior` |
-| Local target source | `themingTargets.test.ts`; `CheckboxList.test.tsx` ref and container case | `checkbox-list` | A rendered class absent from the documented targets, or a missing `astryx-checkbox-list` on the Field root, fails. | `audit:CheckboxList/theming` |
-| Theming anatomy map | `scripts/check-knowledge.mjs` | Canonical anatomy and current local target | Canonical-key drift, invalid dispositions or target spelling, or an unclaimed current local target fails validation. | `audit:CheckboxList/theming` |
+| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
+| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
+| FR1, AR1 | `CheckboxList.test.tsx` group-role, group-description, and disabledMessage cases | Named group; description plus status; disabled reason | A missing group name, or a description and status out of order, fails. Evidence gap: no test asserts the caller description first or the disabled reason last. | `audit:CheckboxList/accessibility` |
+| FR2, FR15 | `CheckboxList.test.tsx` ref and container case; `CheckboxList.fr10.test.tsx` | Standalone; `horizontal-labels` FormLayout | A ref off the group, `container*` off the Field box, or a base prop off the group fails. | `audit:CheckboxList/api` |
+| FR4, FR14 | `CheckboxList.test.tsx` error-status cases, including every checkbox's `aria-invalid`; `CheckboxListErrorStatus.a11y.chromium.spec.ts` | Error with message | A missing status message fails. Evidence gap: no test asserts the empty render without a message. | `audit:CheckboxList/accessibility` |
+| FR6, FR7 | `CheckboxList.test.tsx` add, remove, and pending cases; `CheckboxList.a11y.chromium.spec.ts` `pending-single`, `pending-concurrent`, and `pending-settled` cases | Add; remove; one and two pending values; settled | A wrong array, a cleared earlier pending value, or a busy state that outlives settlement fails. | `audit:CheckboxList/behavior` |
+| FR9, FR10, AR4 | `CheckboxList.test.tsx` group-disabled (including the group's `aria-disabled`), disabledMessage, and read-only cases; `ListGroupDisabled.a11y.chromium.spec.ts`; shared checkbox bindings | Group disabled; with reason; read-only item | A lost tab stop, a toggle while disabled, or a read-only toggle fails. Evidence gap: no test asserts that a focused checkbox is not described by the reason. | `audit:CheckboxList/accessibility` |
+| FR13 | `CheckboxList.test.tsx` density cases; `CheckboxList.a11y.chromium.spec.ts` density, divider, 320-pixel, and RTL cases | Compact, balanced, spacious; dividers; narrow; RTL | A density, divider, overflow, or direction sensor fails. Evidence gap: no test asserts `width` sizing the label, list, and status together. | `audit:CheckboxList/layout` |
+| ORD1–ORD3, PR1 | ORD1 and ORD2 are covered by the FR6 and FR7 rows, ORD3 by the FR9 and FR10 rows. Evidence gap: no test asserts the absence of observers or global listeners | — | — | `audit:CheckboxList/behavior` |
+| Local target source | `themingTargets.test.ts`; `CheckboxList.test.tsx` ref and container case | `checkbox-list` | A rendered class absent from the documented targets, or a missing `astryx-checkbox-list` on the Field root, fails. | `audit:CheckboxList/theming` |
+| Theming anatomy map | `scripts/check-knowledge.mjs` | Canonical anatomy and current local target | Canonical-key drift, invalid dispositions or target spelling, or an unclaimed current local target fails validation. | `audit:CheckboxList/theming` |
Per-option verification is owned by `component:CheckboxListItem`'s
verification map. No current repository check resolves `delegatesTo`
diff --git a/docs/specs/components/RadioList/RadioList.spec.md b/docs/specs/components/RadioList/RadioList.spec.md
index 2468684f03..3e8c21b224 100644
--- a/docs/specs/components/RadioList/RadioList.spec.md
+++ b/docs/specs/components/RadioList/RadioList.spec.md
@@ -113,17 +113,17 @@ Consumer migration instructions belong in consumer docs and release notes.
## Behavioral and layout contract
-| ID | Invariant | Basis |
-| --- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
-| FR1 | RadioList renders a Field in group-label mode (label rendered as a span, visible unless `isLabelHidden`, description, optional or required marker, label tooltip, detached status) around one `role="radiogroup"` element. The radiogroup is labelled by the group label plus any caller `aria-labelledby`, and described by any caller description, then the description, status message, and disabled reason that exist. | WAI-ARIA radio group pattern; current tests |
-| FR2 | Every item's radio shares one `name`: `htmlName` when supplied, otherwise a generated id, so the radios form one native group. The checked radio is the one whose `value` equals the group `value`. | Current tests |
-| FR3 | Selecting an enabled option calls `onChange(value)` once; RadioList holds no selection of its own. | Current tests |
-| FR4 | With an empty `value`, keyboard focus entering the group lands on the first radio that is not natively disabled (in a group disabled with a reason, that is its first `aria-disabled` radio, keeping the enabled focus order under `spec:AST-085` FR1), or stays on the last one when entering backward. Focus moving between radios inside the group is not redirected. With a selection, the selected radio is the Tab stop. Arrow keys follow the browser's native radio behavior, which stops on `aria-disabled` radios. | WAI-ARIA radio group pattern; current tests |
-| FR5 | `isDisabled` MUST disable every item: each radio stays focusable with `aria-disabled="true"`, is detached from the form so it does not submit, and refuses selection (`spec:AST-085` FR1–FR3, FR7). With `disabledMessage`, a reason tooltip also opens on group hover and keyboard focus, and the reason MUST describe each focusable radio (`spec:AST-085` FR5, FR7). Implementation gap: the reason describes only the radiogroup, so a focused radio is not described by it; and without a `disabledMessage`, each radio gets native `disabled` instead, which removes it from the tab order, and a radio focused when the group becomes disabled loses focus (`spec:AST-085` FR4). | `spec:AST-085` FR1–FR5, FR7; current tests |
-| FR6 | `status.type === 'error'` sets `aria-invalid` on the radiogroup. The radiogroup exposes the effective required state (including a form-level default) with `aria-required`, while each radio's native `required` follows only the explicit `isRequired`; a natively required radio's `aria-invalid` follows the same status, so the browser's own invalid state never shows before an error. | Current source and tests |
-| FR7 | The radiogroup lays options in a column with a small gap, or a row with a wider gap when horizontal, and passes `size` to every item. | Current source and tests |
-| FR8 | Base props (`ref`, `id`, `aria-*`, `data-*`, `hidden`, `inert`, `dir`, DOM handlers) reach the radiogroup; a caller `onFocus` runs after FR4's entry handling. `container*` reaches the Field box where one renders (in a `horizontal-labels` FormLayout none renders, and `container*` has no effect and warns), and `control*` the radiogroup; root `xstyle`, `className`, and `style` are not accepted. | `family:input-fields` FR10; current tests |
-| FR9 | The radiogroup carries `astryx-radio-list` and reflects `data-orientation` and `data-size`. | `architecture:component-theming-surface`; current tests |
+| ID | Invariant | Basis |
+| --- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
+| FR1 | RadioList renders a Field in group-label mode (label rendered as a span, visible unless `isLabelHidden`, description, optional or required marker, label tooltip, detached status) around one `role="radiogroup"` element. The radiogroup is labelled by the group label plus any caller `aria-labelledby`, and described by any caller description, then the description, status message, and disabled reason that exist. | WAI-ARIA radio group pattern; current tests |
+| FR2 | Every item's radio shares one `name`: `htmlName` when supplied, otherwise a generated id, so the radios form one native group. The checked radio is the one whose `value` equals the group `value`. | Current tests |
+| FR3 | Selecting an enabled option calls `onChange(value)` once; RadioList holds no selection of its own. | Current tests |
+| FR4 | With an empty `value`, keyboard focus entering the group lands on the first radio that is not natively disabled (in a group disabled with a reason, that is its first `aria-disabled` radio, keeping the enabled focus order under `spec:AST-085` FR1), or stays on the last one when entering backward. Focus moving between radios inside the group is not redirected. With a selection, the selected radio is the Tab stop. Arrow keys follow the browser's native radio behavior, which stops on `aria-disabled` radios. | WAI-ARIA radio group pattern; current tests |
+| FR5 | `isDisabled` MUST disable every item: each radio stays focusable with `aria-disabled="true"`, is detached from the form so it does not submit, and refuses selection (`spec:AST-085` FR1–FR3, FR7). The `radiogroup` element MUST carry `aria-disabled="true"`, as `component:ButtonGroup` FR1 does. With `disabledMessage`, a reason tooltip also opens on group hover and keyboard focus, and the reason MUST describe each focusable radio (`spec:AST-085` FR5, FR7). Implementation gap: the reason describes only the radiogroup, so a focused radio is not described by it; and without a `disabledMessage`, each radio gets native `disabled` instead, which removes it from the tab order, and a radio focused when the group becomes disabled loses focus (`spec:AST-085` FR4). | `spec:AST-085` FR1–FR5, FR7; current tests |
+| FR6 | `status.type === 'error'` sets `aria-invalid` on the radiogroup. The radiogroup exposes the effective required state (including a form-level default) with `aria-required`, while each radio's native `required` follows only the explicit `isRequired`; a natively required radio's `aria-invalid` follows the same status, so the browser's own invalid state never shows before an error. | Current source and tests |
+| FR7 | The radiogroup lays options in a column with a small gap, or a row with a wider gap when horizontal, and passes `size` to every item. | Current source and tests |
+| FR8 | Base props (`ref`, `id`, `aria-*`, `data-*`, `hidden`, `inert`, `dir`, DOM handlers) reach the radiogroup; a caller `onFocus` runs after FR4's entry handling. `container*` reaches the Field box where one renders (in a `horizontal-labels` FormLayout none renders, and `container*` has no effect and warns), and `control*` the radiogroup; root `xstyle`, `className`, and `style` are not accepted. | `family:input-fields` FR10; current tests |
+| FR9 | The radiogroup carries `astryx-radio-list` and reflects `data-orientation` and `data-size`. | `architecture:component-theming-surface`; current tests |
### Allowed variation
@@ -183,15 +183,15 @@ Consumer migration instructions belong in consumer docs and release notes.
## Verification map
-| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
-| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
-| FR1, AR1 | `RadioList.test.tsx` label, span-label, hidden-label, required and optional marker, status, and group-description cases; `RadioGroup.a11y.test.tsx` and `RadioGroup.a11y.chromium.spec.ts` | Visible and hidden label; each status; description | A missing group name or description fails. Evidence gap: no test asserts the caller description first or the disabled reason last, or the label tooltip. | `audit:RadioList/accessibility` |
-| FR2, FR3 | `RadioList.test.tsx` selection and form cases | Radio, label, and description clicks; `htmlName`; no name | A wrong value, lost grouping, wrong form value, or a second `onChange` on a radio click fails. Evidence gap: no test counts `onChange` calls on delegated label and description clicks. | `audit:RadioList/behavior` |
-| FR4, AR2, PR1 | `RadioList.test.tsx` focus-management cases; `RadioGroup.a11y.chromium.spec.ts` `radio-group.focus.entry-and-exit` rule on every `radio-list-group-*` state | Backward entry; intra-group movement; disabled radios | A redirected intra-group move, entry on a natively disabled radio, or Tab entry off the selected or first option fails. Evidence gap: no test enters an empty group disabled with a reason, or asserts a caller `onFocus` after entry handling or the absence of global listeners. | `audit:RadioList/accessibility` |
-| FR5, ORD1, AR3 | `RadioList.test.tsx` disabled, disabledMessage, and form cases; `RadioGroup.a11y.test.tsx` and `RadioGroup.a11y.chromium.spec.ts` `radio-list-group-disabled-with-message` and `radio-list-option-group-disabled` states | Group and item disabled; with reason | A selection while disabled, or a submitted value from a group disabled with a reason, fails; the binding expects `tabReachable: false` for `radio-list-option-group-disabled`, which fails when that gap closes. Evidence gap: no form case submits an item-disabled option or a group disabled without a reason, and no test disables the group while a radio is focused. | `audit:RadioList/accessibility` |
-| FR6, ORD2 | `RadioGroup.a11y.test.tsx` and `RadioGroup.a11y.chromium.spec.ts` `radio-list-group-required-invalid-described` state | Required, invalid, described group | A missing required or invalid state on the group fails. Evidence gap: no test asserts that a form-level required default reaches only `aria-required`. | `audit:RadioList/accessibility` |
-| FR7, FR9 | `RadioList.test.tsx` theme-target case | `size="sm"` | A missing row size fails. Evidence gap: the orientation case asserts only rendering; no test asserts the gaps, horizontal layout, `data-orientation`, `data-size`, or `astryx-radio-list` on the radiogroup. | `audit:RadioList/layout` |
-| FR8 | `RadioList.fr10.test.tsx`; `RadioList.test.tsx` data-testid case | Caller labelledby; hidden, inert, dir; `horizontal-labels` FormLayout | A base prop off the radiogroup, or `container*` off the Field box, fails. Evidence gap: no test asserts a caller `onFocus` runs after entry handling. | `audit:RadioList/api` |
+| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
+| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
+| FR1, AR1 | `RadioList.test.tsx` label, span-label, hidden-label, required and optional marker, status, and group-description cases; `RadioGroup.a11y.test.tsx` and `RadioGroup.a11y.chromium.spec.ts` | Visible and hidden label; each status; description | A missing group name or description fails. Evidence gap: no test asserts the caller description first or the disabled reason last, or the label tooltip. | `audit:RadioList/accessibility` |
+| FR2, FR3 | `RadioList.test.tsx` selection and form cases | Radio, label, and description clicks; `htmlName`; no name | A wrong value, lost grouping, wrong form value, or a second `onChange` on a radio click fails. Evidence gap: no test counts `onChange` calls on delegated label and description clicks. | `audit:RadioList/behavior` |
+| FR4, AR2, PR1 | `RadioList.test.tsx` focus-management cases; `RadioGroup.a11y.chromium.spec.ts` `radio-group.focus.entry-and-exit` rule on every `radio-list-group-*` state | Backward entry; intra-group movement; disabled radios | A redirected intra-group move, entry on a natively disabled radio, or Tab entry off the selected or first option fails. Evidence gap: no test enters an empty group disabled with a reason, or asserts a caller `onFocus` after entry handling or the absence of global listeners. | `audit:RadioList/accessibility` |
+| FR5, ORD1, AR3 | `RadioList.test.tsx` disabled (including the radiogroup's `aria-disabled`), disabledMessage, and form cases; `ListGroupDisabled.a11y.chromium.spec.ts`; `RadioGroup.a11y.test.tsx` and `RadioGroup.a11y.chromium.spec.ts` `radio-list-group-disabled-with-message` and `radio-list-option-group-disabled` states | Group and item disabled; with reason | A selection while disabled, or a submitted value from a group disabled with a reason, fails; the binding expects `tabReachable: false` for `radio-list-option-group-disabled`, which fails when that gap closes. Evidence gap: no form case submits an item-disabled option or a group disabled without a reason, and no test disables the group while a radio is focused. | `audit:RadioList/accessibility` |
+| FR6, ORD2 | `RadioGroup.a11y.test.tsx` and `RadioGroup.a11y.chromium.spec.ts` `radio-list-group-required-invalid-described` state | Required, invalid, described group | A missing required or invalid state on the group fails. Evidence gap: no test asserts that a form-level required default reaches only `aria-required`. | `audit:RadioList/accessibility` |
+| FR7, FR9 | `RadioList.test.tsx` theme-target case | `size="sm"` | A missing row size fails. Evidence gap: the orientation case asserts only rendering; no test asserts the gaps, horizontal layout, `data-orientation`, `data-size`, or `astryx-radio-list` on the radiogroup. | `audit:RadioList/layout` |
+| FR8 | `RadioList.fr10.test.tsx`; `RadioList.test.tsx` data-testid case | Caller labelledby; hidden, inert, dir; `horizontal-labels` FormLayout | A base prop off the radiogroup, or `container*` off the Field box, fails. Evidence gap: no test asserts a caller `onFocus` runs after entry handling. | `audit:RadioList/api` |
## Current-state impact
diff --git a/packages/core/src/CheckboxList/CheckboxList.test.tsx b/packages/core/src/CheckboxList/CheckboxList.test.tsx
index fc84866369..36866eb64e 100644
--- a/packages/core/src/CheckboxList/CheckboxList.test.tsx
+++ b/packages/core/src/CheckboxList/CheckboxList.test.tsx
@@ -1282,3 +1282,40 @@ describe('CheckboxList error status', () => {
expect(screen.getByRole('checkbox')).not.toHaveAttribute('aria-invalid');
});
});
+
+describe('CheckboxList group disabled state', () => {
+ it('marks a disabled group aria-disabled', () => {
+ render(
+ <CheckboxList label="Toppings" isDisabled>
+ <CheckboxListItem value="cheese" label="Cheese" />
+ </CheckboxList>,
+ );
+ expect(screen.getByRole('group', {name: 'Toppings'})).toHaveAttribute(
+ 'aria-disabled',
+ 'true',
+ );
+ });
+
+ it('leaves an enabled group without aria-disabled', () => {
+ render(
+ <CheckboxList label="Toppings">
+ <CheckboxListItem value="cheese" label="Cheese" />
+ </CheckboxList>,
+ );
+ expect(screen.getByRole('group', {name: 'Toppings'})).not.toHaveAttribute(
+ 'aria-disabled',
+ );
+ });
+
+ it("keeps a caller's own aria-disabled on an enabled group (FR15)", () => {
+ render(
+ <CheckboxList label="Toppings" aria-disabled="true">
+ <CheckboxListItem value="cheese" label="Cheese" />
+ </CheckboxList>,
+ );
+ expect(screen.getByRole('group', {name: 'Toppings'})).toHaveAttribute(
+ 'aria-disabled',
+ 'true',
+ );
+ });
+});
diff --git a/packages/core/src/CheckboxList/CheckboxList.tsx b/packages/core/src/CheckboxList/CheckboxList.tsx
index 2d9c47d55c..3007a609d4 100644
--- a/packages/core/src/CheckboxList/CheckboxList.tsx
+++ b/packages/core/src/CheckboxList/CheckboxList.tsx
@@ -300,6 +300,10 @@ export function CheckboxList({
controlStyle,
)}
role="group"
+ // Screen readers announce the whole group as unavailable. Its dimmed
+ // label then labels a disabled control. An enabled list keeps a
+ // caller's own value.
+ aria-disabled={isDisabled || rest['aria-disabled']}
// A caller aria-labelledby names the group together with its label.
aria-labelledby={joinAriaIDs(labelID, ariaLabelledByProp)}
aria-describedby={
diff --git a/packages/core/src/CheckboxList/__tests__/ListGroupDisabled.a11y.chromium.spec.ts b/packages/core/src/CheckboxList/__tests__/ListGroupDisabled.a11y.chromium.spec.ts
new file mode 100644
index 0000000000..241470c4de
--- /dev/null
+++ b/packages/core/src/CheckboxList/__tests__/ListGroupDisabled.a11y.chromium.spec.ts
@@ -0,0 +1,90 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+// @pr-a11y scope core/CheckboxList core/RadioList
+
+/**
+ * @file ListGroupDisabled.a11y.chromium.spec.ts
+ * @input The built Core/CheckboxList and Core/RadioList Disabled stories;
+ * Chromium's accessibility tree
+ * @output Browser evidence that a disabled CheckboxList or RadioList exposes
+ * its group as disabled, and an enabled one does not
+ * @position Chromium proof for the group-level aria-disabled on both lists
+ */
+
+import {expect, test, type Page} from '@playwright/test';
+import {holdMotionStill} from '@astryxdesign/a11y-spec/chromium';
+import {
+ DEFAULT_STORYBOOK_DIR,
+ serveStorybook,
+ type StaticServer,
+} from '@astryxdesign/a11y-spec/storybook';
+
+let storybook: StaticServer;
+test.beforeAll(async () => {
+ storybook = await serveStorybook(
+ process.env.ASTRYX_STORYBOOK_DIR ?? DEFAULT_STORYBOOK_DIR,
+ );
+});
+test.afterAll(async () => {
+ await storybook?.close();
+});
+
+const CASES = [
+ {
+ story: 'core-checkboxlist--disabled',
+ role: 'group',
+ name: 'Notification preferences',
+ },
+ {
+ story: 'core-radiolist--disabled',
+ role: 'radiogroup',
+ name: 'Notification preference',
+ },
+] as const;
+
+/** The disabled state Chromium's own accessibility tree reports for the group. */
+async function axDisabled(
+ page: Page,
+ role: string,
+ name: string,
+): Promise<boolean | null> {
+ const cdp = await page.context().newCDPSession(page);
+ const {nodes} = (await cdp.send('Accessibility.getFullAXTree')) as {
+ nodes: {
+ role?: {value?: string};
+ name?: {value?: string};
+ properties?: {name: string; value: {value?: unknown}}[];
+ }[];
+ };
+ await cdp.detach();
+ const node = nodes.find(
+ n => n.role?.value === role && n.name?.value === name,
+ );
+ if (node == null) {
+ return null;
+ }
+ return (
+ node.properties?.find(p => p.name === 'disabled')?.value.value === true
+ );
+}
+
+for (const {story, role, name} of CASES) {
+ test(`${story}: the ${role} is exposed as disabled`, async ({page}) => {
+ await page.goto(
+ `${storybook.origin}/iframe.html?id=${story}&viewMode=story`,
+ );
+ await holdMotionStill(page);
+ await expect(page.getByRole(role, {name})).toBeVisible();
+ expect(await axDisabled(page, role, name)).toBe(true);
+ });
+
+ test(`${story} with isDisabled off: the ${role} is not disabled`, async ({
+ page,
+ }) => {
+ await page.goto(
+ `${storybook.origin}/iframe.html?id=${story}&viewMode=story&args=isDisabled:!false`,
+ );
+ await holdMotionStill(page);
+ await expect(page.getByRole(role, {name})).toBeVisible();
+ expect(await axDisabled(page, role, name)).toBe(false);
+ });
+}
diff --git a/packages/core/src/RadioList/RadioList.doc.mjs b/packages/core/src/RadioList/RadioList.doc.mjs
index adce608039..7cf754c1b7 100644
--- a/packages/core/src/RadioList/RadioList.doc.mjs
+++ b/packages/core/src/RadioList/RadioList.doc.mjs
@@ -148,12 +148,14 @@ export const docs = {
{
name: 'containerClassName',
type: 'string',
- description: 'Class name for the field container. Same targeting as `containerXstyle`.',
+ description:
+ 'Class name for the field container. Same targeting as `containerXstyle`.',
},
{
name: 'containerStyle',
type: 'CSSProperties',
- description: 'Inline styles for the field container. Same targeting as `containerXstyle`.',
+ description:
+ 'Inline styles for the field container. Same targeting as `containerXstyle`.',
},
{
name: 'controlXstyle',
diff --git a/packages/core/src/RadioList/RadioList.test.tsx b/packages/core/src/RadioList/RadioList.test.tsx
index 043de3ca41..c9dc9811db 100644
--- a/packages/core/src/RadioList/RadioList.test.tsx
+++ b/packages/core/src/RadioList/RadioList.test.tsx
@@ -1140,3 +1140,44 @@ describe('pressed state', () => {
expect(readsPressStrength(row, '[data-astryx-press="on"]')).toBe(false);
});
});
+
+describe('RadioList group disabled state', () => {
+ it('marks a disabled radiogroup aria-disabled', () => {
+ render(
+ <RadioList label="Size" isDisabled value="small" onChange={() => {}}>
+ <RadioListItem value="small" label="Small" />
+ </RadioList>,
+ );
+ expect(screen.getByRole('radiogroup', {name: 'Size'})).toHaveAttribute(
+ 'aria-disabled',
+ 'true',
+ );
+ });
+
+ it('leaves an enabled radiogroup without aria-disabled', () => {
+ render(
+ <RadioList label="Size" value="small" onChange={() => {}}>
+ <RadioListItem value="small" label="Small" />
+ </RadioList>,
+ );
+ expect(screen.getByRole('radiogroup', {name: 'Size'})).not.toHaveAttribute(
+ 'aria-disabled',
+ );
+ });
+
+ it("keeps a caller's own aria-disabled on an enabled radiogroup (FR8)", () => {
+ render(
+ <RadioList
+ label="Size"
+ value="small"
+ onChange={() => {}}
+ aria-disabled="true">
+ <RadioListItem value="small" label="Small" />
+ </RadioList>,
+ );
+ expect(screen.getByRole('radiogroup', {name: 'Size'})).toHaveAttribute(
+ 'aria-disabled',
+ 'true',
+ );
+ });
+});
diff --git a/packages/core/src/RadioList/RadioList.tsx b/packages/core/src/RadioList/RadioList.tsx
index cc1dd1def0..3ab2a19c35 100644
--- a/packages/core/src/RadioList/RadioList.tsx
+++ b/packages/core/src/RadioList/RadioList.tsx
@@ -403,6 +403,10 @@ export function RadioList({
disabledMessageTooltip.ref(el);
}}
role="radiogroup"
+ // Screen readers announce the whole group as unavailable. Its dimmed
+ // label then labels a disabled control. An enabled list keeps a
+ // caller's own value.
+ aria-disabled={isDisabled || rest['aria-disabled']}
// A caller aria-labelledby names the group together with its label.
aria-labelledby={joinAriaIDs(labelID, ariaLabelledByProp)}
onFocus={composeEventHandlers(handleFocus, onFocus)}