Skip to content

fix(Item): keep disabled actions keyboard-reachable - #11169

Merged
cixzhang merged 2 commits into
meta:mainfrom
aashish254:fix/item-disabled-action-focusable
Nov 11, 2026
Merged

cixzhang merged 2 commits into
meta:mainfrom
aashish254:fix/item-disabled-action-focusable

Conversation

@aashish254

Copy link
Copy Markdown
Contributor

Fixes #7818.

User impact

Keyboard and screen-reader users can reach disabled Item actions, hear that they are unavailable, and keep their place if an action becomes disabled while focused.

Problem and solution fit

  • The disabled button used native disabled, and the disabled link used tabIndex={-1}, removing both from the normal Tab sequence.
  • Users who navigate by keyboard could not reach those unavailable actions or read their disabled state; changing a focused action to disabled could also drop focus.
  • That prevents users from understanding the row's state and maintaining context while navigating.

The fix follows spec:AST-085: retain the focusable control, expose aria-disabled, remove the disabled link's destination, and block activation.

Expected behavior and authority

AST-085 FR1–FR2 require disabled controls to stay in their enabled Tab order, expose aria-disabled="true", and block activation or navigation. FR4 requires a focused control to keep focus when it becomes disabled. FR6 preserves the focus indicator.

Smallest restoration

Disabled Item buttons now use the shared disabled-interaction guards without a native disabled attribute. Disabled links stay at tabIndex={0} and lose their destination. Tests and Item's browser audit cover the keyboard behavior; ListItem docs and tests reflect the inherited Item behavior.

Evidence

  • Reproduction before the change: the disabled button was natively disabled and the disabled link had tabIndex={-1}.
  • Result after the change: both remain keyboard-reachable and expose disabled state; disabled actions do not activate, and the browser audit confirms the disabled row retains its visible focus ring.
  • Representative unchanged path: enabled Item buttons and links keep their existing behavior; swipe actions remain unchanged.
  • Regression proof: focused tests cover Tab order, focus retention, and blocked keyboard/click activation; the Chromium audit covers real browser focus order and focus styling.

Scope

Components: core/Item, core/List (ListItem)

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run packages/core/src/Item/Item.test.tsx packages/core/src/List/List.test.tsx — 190 tests passed.
  • pnpm exec playwright test packages/core/src/Item/__tests__/ItemAudit.a11y.chromium.spec.ts --config playwright.config.ts --project chromium — 15 tests passed, including the disabled Tab stop and focus ring.
  • pnpm -F @astryxdesign/core typecheck — passed.
  • pnpm check:changesets, Prettier, ESLint, and the commit hook's repository checks — passed.

@vercel

vercel Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 11, 2026 11:35am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 11, 2026
@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge labels Nov 11, 2026
@astracat-bot

astracat-bot Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 11, 2026, 11:47 AM UTC

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 5016e84

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
ContextMenuItem 33.1 kB (+144 B) · 6.3 kB CSS (0) — — · — · —
MoreMenu 101.4 kB (+143 B) · 17.6 kB CSS (0) — — · — · —
DropdownMenu 101.2 kB (+136 B) · 17.6 kB CSS (0) — — · — · —
25 more components
Component Size LoC Visual · A11y · RTL
SelectorOption 21.2 kB (+86 B) · 6.1 kB CSS (0) — — · — · —
DropdownMenuCheckboxItem 23.5 kB (+73 B) · 6.6 kB CSS (0) — — · — · —
Item · Storybook 17.7 kB (+71 B) · 5.5 kB CSS (0) 1,751 (+4) ✓ · ✓ · —
DropdownMenuRadioItem 23.5 kB (+70 B) · 6.6 kB CSS (0) — — · — · —
RadioListItem 70.3 kB (+55 B) · 10.2 kB CSS (0) — — · — · —
DropdownMenuItem 22.6 kB (+52 B) · 6.3 kB CSS (0) — — · — · —
BreadcrumbItem 88.8 kB (+49 B) · 12.1 kB CSS (0) — — · — · —
DropdownMenuSubMenu 72.1 kB (+33 B) · 9.7 kB CSS (0) — — · — · —
Table 129.3 kB (+27 B) · 18.4 kB CSS (0) — — · — · —
lab/TransferListSelector 114.0 kB (+22 B) · 1.4 kB CSS (0) — — · — · —
CheckboxListItem 74.2 kB (+21 B) · 11.5 kB CSS (0) — — · — · —
richtext/RichTextEditorToolbar 283.4 kB (+21 B) · 454 B CSS (0) — — · — · —
lab/TransferList 105.3 kB (+20 B) · 1.2 kB CSS (0) — — · — · —
Markdown 192.3 kB (+19 B) · 20.8 kB CSS (0) — — · — · —
TableCell 113.4 kB (+18 B) · 17.9 kB CSS (0) — — · — · —
TableHeaderCell 112.9 kB (+18 B) · 17.7 kB CSS (0) — — · — · —
lab/CommentThread 350.6 kB (+16 B) · 2.4 kB CSS (0) — — · — · —
ContextMenu 112.1 kB (+15 B) · 17.5 kB CSS (0) — — · — · —
lab/Comments 357.5 kB (+14 B) · 2.5 kB CSS (0) — — · — · —
ListItem 73.2 kB (+12 B) · 11.5 kB CSS (0) — ✓ · ✓ · ✓
Pagination 114.5 kB (+12 B) · 17.8 kB CSS (0) — — · — · —
Selector 104.4 kB (+9 B) · 17.4 kB CSS (0) — — · — · —
lab/TabBarMoreList 95.4 kB (+3 B) · 1.8 kB CSS (0) — — · — · —
List 18.9 kB (0) · 790 B CSS (0) — ✓ · ✓ · —
PowerSearch · Storybook 295.5 kB (−4 B) · 24.5 kB CSS (0) 7,140 (0) ✓ · ✓ · ✓

Package size: @astryxdesign/core 7.32 MB packed (+106 B); no new dependencies.

Touched components checked; add ci:run-visual or ci:run-rtl to run the full suites.

Accessibility: 1 violation(s)

Accessibility Audit

Status: 1 accessibility violation(s) found — 1 serious.

PowerSearch - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/37 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet. A maintainer adds the ci:run label so CI runs.

Disabled Item actions now keep their Tab stop, expose aria-disabled, and stay inert, as AST-085 FR1, FR2, FR4 and FR6 require; the changed tests fail before the fix and pass after it, and real-browser checks confirm the Tab order, blocked Enter and Space, and the disabled state in the accessibility tree.

  • Optional: the changeset could also say that disabled Item and ListItem actions use aria-disabled instead of the native disabled attribute, so :disabled and toBeDisabled() no longer match them; AST-085 asks release notes to name that change.

Automated review (maintainer link)

'@astryxdesign/core': patch
---

[fix] Keep disabled Item actions focusable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: consumers who match these buttons with :disabled or toBeDisabled() will see them stop matching (this PR made that switch in List.test.tsx). AST-085 asks release notes to name that, for example:

[fix] Disabled Item and ListItem actions stay in the Tab order and use `aria-disabled` instead of the native `disabled` attribute, so `:disabled` and `toBeDisabled()` no longer match them.

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 31fd6b3

@cixzhang cixzhang added ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) labels Nov 11, 2026
@cixzhang
cixzhang marked this pull request as draft November 11, 2026 10:04
@cixzhang
cixzhang marked this pull request as ready for review November 11, 2026 10:05
…ot native disabled

The Item action now stays focusable when disabled (spec:AST-085 FR1), so
the read-only field picker's Status row carries aria-disabled="true"
instead of the disabled attribute. The click still does nothing.
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 5016e84

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: the CI run on this head was refused for capacity ("CI is full"), so its tests have not run here yet; a maintainer re-runs the CI jobs.

Disabled Item and ListItem actions now keep their Tab stop, expose aria-disabled, and stay inert, as AST-085 FR1, FR2, FR4 and FR6 require; the changed tests fail before the fix and pass after it, and real-browser checks confirm the Tab order, blocked Enter and Space, and the disabled state in the accessibility tree.

  • Optional: the changeset could also say that disabled Item and ListItem actions use aria-disabled instead of the native disabled attribute, so :disabled and toBeDisabled() no longer match them.

Automated review (maintainer link)

@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Nov 11, 2026
@cixzhang
cixzhang merged commit 2a74aeb into meta:main Nov 11, 2026
116 of 122 checks passed

This branch was successfully deployed

1 active deployment
Preview — 5016e841 Deployed Nov 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) CLA Signed This label is managed by the Meta Open Source bot. community Authored by a community contributor (not on the eng/design team)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Navigation and item controls render native disabled

2 participants