Skip to content

fix(core): make disabled Button focusable via aria-disabled per AST-085 - #7906

Merged
cixzhang merged 23 commits into
meta:mainfrom
Geervan:fix/AST-085-focusable-disabled
Nov 7, 2026
Merged

cixzhang merged 23 commits into
meta:mainfrom
Geervan:fix/AST-085-focusable-disabled

Conversation

@Geervan

@Geervan Geervan commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #7813

User impact

Keyboard and screen-reader users could not reach disabled buttons or discover why they are unavailable because Button rendered the native disabled attribute. When a focused button became disabled dynamically (such as navigating to the last page in Pagination or the maximum date in Calendar), keyboard focus dropped directly to document.body, disorienting the user. Any component relying on Button with isDisabled inherited this failure.

With this restoration, disabled buttons stay in the enabled focus order, keep focus when they become disabled while focused, expose aria-disabled="true", and block all activation paths (pointer, keyboard Enter/Space, clickAction). A link Button (href) is the exception: it becomes a <button> when disabled, so a focused link Button still moves focus.

Problem and solution fit

  1. Why did the defect occur? Button previously only used aria-disabled if isLoading or tooltip was present; otherwise, it rendered the native disabled attribute on <button>.
  2. Why does it harm the task? Native disabled elements are removed by the browser engine from the tab sequence. When a focused control receives native disabled, the browser immediately evicts focus to document.body.
  3. Why does that harm matter? Sighted keyboard users lose visual feedback and their place in the application, and assistive technology users cannot inspect disabled controls or perceive disabled states and reasons.

Fit: In accordance with AST-085, we remove the native disabled attribute, expose aria-disabled="true", and ensure all click/activation paths remain blocked and event propagation is stopped.

Expected behavior and authority

  • Governing spec: AST-085 Focusable disabled controls system spec (FR1–FR3, FR6, FR7, and FR4 for every Button that is not a link).
  • Buttons must not render native disabled. They must expose aria-disabled="true", retain focus on disablement, stay in the enabled tab order, and block activation.

Smallest restoration

  • packages/core/src/Button/Button.tsx:
    • Removed disabled attribute from <button>.
    • Kept handleClick prevention/stop-propagation and handleKeyDown suppression of Enter/Space while disabled.
    • A disabled named submit Button withholds name, so new FormData(form, submitter) leaves out its value (FR3).
  • packages/core/src/Button/Button.doc.mjs:
    • Updated isDisabled documentation across locales to reflect focusable aria-disabled.
  • packages/core/src/Button/Button.test.tsx:
    • Updated assertions from toBeDisabled()/toHaveAttribute('disabled') to toHaveAttribute('aria-disabled', 'true') and not.toHaveAttribute('disabled').
  • Added patch changeset credited to @Geervan.

Evidence

  • Reproduction before the change: In Pagination (Core/Pagination story), focusing Next and pressing Enter until page 10 caused document.activeElement === document.body and the focus ring disappeared.
  • Result after the change: At page 10, the Next button disables with aria-disabled="true", and focus remains on the button with the focus ring visible.
  • Representative unchanged path: Standalone button click handling, loading spinner, and variant styling remain identical.
  • Regression test or other mutation-sensitive proof: All 63 unit tests in Button.test.tsx pass.

Maintainer follow-up (2026-11-06)

This PR went two weeks without activity, so a maintainer carried it on this branch. Geervan's commits are kept, and each review point is listed below with where it was addressed.

  • Review of 11/03, changeset overstated the change (link mode): the changeset and User impact now leave link Buttons out of the focus claim, and the claimed FRs are narrowed. See the merge commit "Merge main into the focusable disabled Button".
  • Review of 11/03, Pagination dots claim: dropped. The dots were already aria-disabled with a roving tab stop.
  • Review of 11/03, merge conflicts with main: main is merged in. Button.tsx keeps main's input-group item props and has no native disabled. Button.test.tsx keeps both sides' tests. The ButtonGroup doc keeps main's touch guidance.
  • Review of 11/03, newer tests still assert toBeDisabled() on Buttons: they now read aria-disabled. That covers PowerSearch's Add filter, the Persian Calendar's month buttons, and ListInput's Add.
  • Review of 11/03, optional comment wording: the click-guard comment is shorter, and the useAriaDisabled alias is gone. The key-guard and Carousel comments give their reasons without record citations (lint).
  • main changed useListFocus while this PR was open: main now documents that no item holds the Tab stop while every item is disabled, unless the owner places it with tabStopOrder. This PR's change to that default is reverted. ButtonGroup instead passes tabStopOrder while it is disabled, so a group disabled as a whole keeps its one Tab stop, and other roving groups are unchanged.
  • main made ListInput's reorder grip a plain <button>: this PR's ListInput source change and its reorder-grip assertions return to main's, since that control is not a Button.
  • Review of 11/06, a read-only Toolbar gave each disabled Button a Tab stop: Toolbar now passes a tabStopOrder that keeps one stop while every control is disabled and places it as the default does otherwise. useListFocus exports that order as oneTabStopAmong, and ButtonGroup uses the same order while it is disabled. Test: "stays a single tab stop when every control is a disabled Button".
  • Review of 11/06, ChatComposerInput.test.tsx after merging main: main is merged again, and the Send assertions read aria-disabled.
  • Test runs on the earlier head: Core 19,625 tests across four shards; failures are only main's local Resizable and postinstall cases, which fail the same way on main, plus one DateInput timing case that passes alone. Lab, richtext and charts: 1,763 passed. tsc passes for core and lab. On this head: Toolbar, ButtonGroup, Button, Chat, SegmentedControl, Pagination and useListFocus tests pass (936), and lint and tsc are clean.

Real-browser boundary check (this head's Vercel preview Storybook, Chromium)

Focus a boundary control, press Enter once per step until the edge, and read document.activeElement after each press. The same check ran against a main Storybook (add0516).

Story Control main This head
core-pagination--default Go to next page focus on <body> from press 9 (the control turns natively disabled) focus stays on Go to next page; aria-disabled="true" at page 10
core-calendar--min-max-boundary Next month focus on <body> from press 2 focus stays on Next month; aria-disabled="true" at the max month
core-lightbox--gallery Next focus on <body> from press 3 (4 / 4) focus stays on Next; aria-disabled="true" at 4 / 4

DateInput's touch sheet month arrows are a separate cause, out of this PR's scope: at the range end the arrow is hidden, so focus drops even with an aria-disabled Button. A separate fix moves focus first to the other arrow.

Scope

  • 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 test packages/core/src/Button/Button.test.tsx
pnpm check:sync
pnpm check:changesets

@vercel

vercel Bot commented Oct 22, 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 7, 2026 9:59am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 22, 2026
@astracat-bot

astracat-bot Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 7, 2026, 10:13 AM UTC

@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 Oct 22, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · c843c4a

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
ChatComposerInput 72.5 kB (−13 B) · 11.2 kB CSS (0) — — · ✗ · —
PowerSearch · Storybook 279.3 kB (−16 B) · 23.5 kB CSS (0) 7,201 (0) — · ✗ · —
ChatComposer 74.5 kB (−21 B) · 11.7 kB CSS (0) — — · ✗ · —
103 more components
Component Size LoC Visual · A11y · RTL
Toolbar · Storybook 40.8 kB (+108 B) · 7.9 kB CSS (0) 274 (+5) — · ✓ · —
ButtonGroup · Storybook 40.3 kB (+88 B) · 3.7 kB CSS (0) 153 (+7) — · ✓ · —
lab/Schedule 102.4 kB (+88 B) · 3.9 kB CSS (0) — — · — · —
TableSelectionToolbar 67.6 kB (+68 B) · 13.0 kB CSS (0) — — · — · —
richtext/RichTextEditorToolbar 248.3 kB (+67 B) · 454 B CSS (0) — — · — · —
Carousel · Storybook 66.9 kB (+14 B) · 10.8 kB CSS (0) 605 (+6) — · ✓ · —
DropdownMenuSubMenu 67.9 kB (+11 B) · 9.7 kB CSS (0) — — · ✓ · —
lab/CommentPin 54.4 kB (+5 B) · 1.2 kB CSS (0) — — · — · —
lab/Comments 321.2 kB (+5 B) · 2.5 kB CSS (0) — — · ✓ · —
TabList 41.6 kB (+3 B) · 6.4 kB CSS (0) — — · — · —
lab/TransferList 105.3 kB (+2 B) · 1.7 kB CSS (0) — — · ✓ · —
AvatarGroup 43.7 kB (+1 B) · 5.6 kB CSS (0) — — · — · —
Timestamp 31.2 kB (+1 B) · 10.2 kB CSS (0) — — · — · —
BottomSheet 64.0 kB (0) · 7.5 kB CSS (0) — — · ✓ · —
BottomSheetSwitcher 17.7 kB (0) · 3.4 kB CSS (0) — — · — · —
ChatComposerDrawer 17.7 kB (0) · 4.7 kB CSS (0) — — · ✓ · —
ChatMessage 16.8 kB (0) · 3.7 kB CSS (0) — — · ✓ · —
ChatMessageBubble 7.2 kB (0) · 3.7 kB CSS (0) — — · ✓ · —
ChatMessageList 26.5 kB (0) · 7.0 kB CSS (0) — — · ✓ · —
ChatMessageMetadata 19.9 kB (0) · 4.1 kB CSS (0) — — · ✓ · —
ChatSystemMessage 7.0 kB (0) · 3.8 kB CSS (0) — — · ✓ · —
ChatTokenizedText 7.2 kB (0) · 4.0 kB CSS (0) — — · ✓ · —
ChatToolCalls 30.4 kB (0) · 8.3 kB CSS (0) — — · ✓ · —
ContextMenuItem 27.5 kB (0) · 6.3 kB CSS (0) — — · — · —
Drawer 48.4 kB (0) · 8.2 kB CSS (0) — — · ✓ · —
DropdownMenuCheckboxItem 21.8 kB (0) · 6.6 kB CSS (0) — — · — · —
DropdownMenuDivider 5.2 kB (0) · 548 B CSS (0) — — · ✓ · —
DropdownMenuGroup 6.3 kB (0) · 3.4 kB CSS (0) — — · ✓ · —
DropdownMenuItem 21.0 kB (0) · 6.3 kB CSS (0) — — · ✓ · —
DropdownMenuRadioGroup 6.3 kB (0) · 3.3 kB CSS (0) — — · ✓ · —
DropdownMenuRadioItem 21.8 kB (0) · 6.6 kB CSS (0) — — · ✓ · —
LayerProvider 4.1 kB (0) · 20 B CSS (0) — — · — · —
Markdown 177.3 kB (0) · 20.0 kB CSS (0) — — · — · —
TableBody 3.5 kB (0) · 3.3 kB CSS (0) — — · — · —
TableFooter 3.5 kB (0) · 3.3 kB CSS (0) — — · — · —
TableHeader 3.5 kB (0) · 3.3 kB CSS (0) — — · — · —
TableRow 6.7 kB (0) · 3.9 kB CSS (0) — — · — · —
ToggleButtonGroup 6.6 kB (0) · 3.4 kB CSS (0) — — · — · —
NavHeadingMenu 15.7 kB (−1 B) · 3.5 kB CSS (0) — — · — · —
AppShell 88.3 kB (−2 B) · 13.4 kB CSS (0) — — · — · —
DropdownMenu 93.7 kB (−2 B) · 17.1 kB CSS (0) — — · ✓ · —
Stepper 59.6 kB (−2 B) · 10.0 kB CSS (0) — — · — · —
TabMenu 69.1 kB (−2 B) · 11.0 kB CSS (0) — — · — · —
SideNavHeading 72.9 kB (−4 B) · 11.2 kB CSS (0) — — · — · —
TableCell 106.5 kB (−4 B) · 17.4 kB CSS (0) — — · — · —
TableHeaderCell 106.1 kB (−4 B) · 17.2 kB CSS (0) — — · — · —
TopNavHeading 72.3 kB (−4 B) · 11.0 kB CSS (0) — — · — · —
lab/TransferListSelector 111.9 kB (−4 B) · 1.9 kB CSS (0) — — · ✓ · —
SegmentedControl 91.2 kB (−5 B) · 6.8 kB CSS (0) — — · — · —
lab/DiffViewer 84.3 kB (−5 B) · 2.1 kB CSS (0) — — · — · —
lab/ChatReactionBar 101.8 kB (−6 B) · 1.1 kB CSS (0) — — · — · —
lab/TourStep 92.5 kB (−6 B) · 590 B CSS (0) — — · — · —
Calendar · Storybook 69.0 kB (−7 B) · 10.5 kB CSS (0) 1,747 (0) — · ✓ · —
SideNav 87.7 kB (−7 B) · 11.3 kB CSS (0) — — · — · —
DateRangeInput 89.4 kB (−8 B) · 12.3 kB CSS (0) — — · — · —
MobileNav 68.2 kB (−8 B) · 10.5 kB CSS (0) — — · — · —
TextInput 65.4 kB (−9 B) · 11.0 kB CSS (0) — — · — · —
lab/CommentComposer 142.2 kB (−9 B) · 1.9 kB CSS (0) — — · — · —
DialogHeader 60.8 kB (−10 B) · 11.4 kB CSS (0) — — · — · —
Pagination · Storybook 106.6 kB (−10 B) · 17.5 kB CSS (0) 658 (0) — · ✓ · —
ContextMenu 105.3 kB (−11 B) · 17.0 kB CSS (0) — — · — · —
Toast 95.5 kB (−11 B) · 10.2 kB CSS (0) — — · — · —
TopNavMegaMenu 67.1 kB (−11 B) · 11.7 kB CSS (0) — — · — · —
lab/ChatEmojiPicker 100.6 kB (−11 B) · 773 B CSS (0) — — · — · —
NumberInput 69.4 kB (−12 B) · 11.3 kB CSS (0) — — · — · —
Tokenizer 88.1 kB (−12 B) · 18.3 kB CSS (0) — — · — · —
lab/CommentThread 316.3 kB (−12 B) · 2.4 kB CSS (0) — — · — · —
ChatComposerTokenElement 72.5 kB (−13 B) · 11.2 kB CSS (0) — — · ✓ · —
lab/ListInput · Storybook 98.8 kB (−13 B) · 1.6 kB CSS (0) 1,760 (0) — · ✓ · —
MoreMenu 94.0 kB (−14 B) · 17.1 kB CSS (0) — — · — · —
Typeahead 76.6 kB (−14 B) · 12.3 kB CSS (0) — — · — · —
TopNav 69.8 kB (−15 B) · 10.8 kB CSS (0) — — · — · —
Button · Storybook 58.0 kB (−16 B) · 9.9 kB CSS (0) 686 (−2) — · ✓ · —
Table 114.7 kB (−16 B) · 17.7 kB CSS (0) — — · ✓ · —
ToggleButton 58.9 kB (−16 B) · 10.0 kB CSS (0) — — · ✓ · —
DateTimeInput · Storybook 202.1 kB (−17 B) · 18.4 kB CSS (0) 3,567 (0) — · ✓ · —
Selector 96.5 kB (−17 B) · 17.1 kB CSS (0) — — · — · —
Thumbnail 62.4 kB (−17 B) · 11.5 kB CSS (0) — — · — · —
BreadcrumbItem 82.0 kB (−18 B) · 12.0 kB CSS (0) — — · — · —
IconButton · Storybook 58.0 kB (−18 B) · 9.9 kB CSS (0) 17 (0) — · ✓ · —
TopNavMenu 71.9 kB (−18 B) · 11.1 kB CSS (0) — — · — · —
richtext/RichTextEditor 294.0 kB (−18 B) · 2.6 kB CSS (0) — — · — · —
MultiSelector 91.8 kB (−19 B) · 16.6 kB CSS (0) — — · — · —
TimeInput 156.4 kB (−19 B) · 15.7 kB CSS (0) — — · — · —
Banner 60.0 kB (−21 B) · 10.4 kB CSS (0) — — · — · —
BaseTypeahead 68.2 kB (−21 B) · 10.8 kB CSS (0) — — · — · —
FileInput 66.8 kB (−21 B) · 10.8 kB CSS (0) — — · — · —
MobileNavToggle 58.3 kB (−21 B) · 9.9 kB CSS (0) — — · — · —
SideNavCollapseButton 58.8 kB (−21 B) · 9.9 kB CSS (0) — — · — · —
DateInput · Storybook 179.9 kB (−22 B) · 16.7 kB CSS (0) 5,636 (0) — · ✓ · —
DrawerHeader 61.0 kB (−22 B) · 12.8 kB CSS (0) — — · ✓ · —
ComplexSelector 68.3 kB (−23 B) · 11.7 kB CSS (0) — — · — · —
SideNavItem 67.9 kB (−23 B) · 11.0 kB CSS (0) — — · — · —
CodeBlock 72.7 kB (−24 B) · 11.2 kB CSS (0) — — · — · —
Lightbox · Storybook 109.2 kB (−24 B) · 10.3 kB CSS (0) 2,472 (0) — · ✓ · —
ChatLayoutScrollButton 58.5 kB (−25 B) · 10.1 kB CSS (0) — — · — · —
Popover 86.1 kB (−25 B) · 13.9 kB CSS (0) — — · — · —
ChatDictationButton 58.5 kB (−26 B) · 10.0 kB CSS (0) — — · ✓ · —
richtext/RichTextView 273.7 kB (−28 B) · 2.3 kB CSS (0) — — · — · —
ChatLayout 61.3 kB (−29 B) · 10.4 kB CSS (0) — — · ✓ · —
ChatSendButton 58.4 kB (−31 B) · 9.9 kB CSS (0) — — · — · —
AlertDialog 102.4 kB (−32 B) · 14.2 kB CSS (0) — — · — · —
lab/EmojiPicker 83.9 kB (−33 B) · 751 B CSS (0) — — · — · —

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

API changes: none in this pull request

Committed API report behind this build: cli 19 rows, core 25 rows; run pnpm api:report.

Wide change (21 components): add ci:run-visual or ci:run-rtl to run them.

Accessibility: 3 violation(s)

Accessibility Audit

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

ChatComposer - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/19 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
ChatComposerInput - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
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/36 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.

Thanks for restoring focusable disabled Buttons: the core change works, and Pagination, Calendar and Lightbox now keep focus on the disabled arrow at their boundaries. Changes are needed before approval, because the switch exposes places that still relied on native disabled:

  • ListInput: ArrowUp and ArrowDown on a disabled or loading reorder handle still reorder rows, so handleReorderKeyDown needs a mutationsDisabled guard and a test.
  • Carousel: the hidden scroll buttons (opacity: 0) are now invisible Tab stops, so hide the inactive pill with visibility: hidden or inert as TouchDateField does.
  • useListFocus: when no item is enabled, keep one Tab stop instead of setting every item to tabindex="-1" (AST-085 FR1 and FR7); today this hides a disabled ButtonGroup and Pagination's disabled dots row from the keyboard.
  • The disabled rows in Button.a11y.states.ts and ToggleButton.a11y.states.ts still declare focusable: false, which is why the pr-a11y check fails.

[Automated review]

Comment thread packages/core/src/hooks/useListFocus.ts Resolved
Comment thread packages/core/src/Carousel/Carousel.tsx Resolved
Comment thread packages/core/src/Button/Button.tsx Resolved
@vercel

vercel Bot commented Oct 22, 2026

Copy link
Copy Markdown

Deployment failed for project astryx with the following error:

The provided GitHub repository does not contain the requested branch or commit reference. Please ensure the repository is not empty.

@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.

Thanks, the core change works: disabled Buttons now stay focusable with aria-disabled, Pagination, Calendar and Lightbox keep focus at their boundaries, and the ListInput, Carousel, roving-group and inventory issues raised on the first commit are fixed. Two small follow-ups remain before approval:

  • ButtonGroup.doc.mjs (English, Chinese and dense docs) still says a disabled member drops focus, which is no longer true with this change; drop or replace that reason.
  • MenuButton.a11y.states.ts still declares the disabled DropdownMenu trigger focusable: false; it is now a Tab stop, so mark it focusable as you did for the Button and ToggleButton rows, which lets the contract check that it stays closed on the opening keys.

[Automated review]

cixzhang added a commit that referenced this pull request Oct 22, 2026
## Exact decision needed

Where keyboard focus goes when the focused Carousel edge scroll button runs out of content in its direction.

## Existing authority searched

- `spec:AST-085` FR1 and FR4 (current): disabled controls stay focusable; a component may name a focus destination for a control it removes, in its own record.
- `spec:AST-025` FR12 (current): owns the scroll area's tab stop and naming.
- `family:buttons` (current): owns edge button behavior while available.
- No `component:Carousel` record exists. Shipped code moves focus to the opposite edge button, falling back to the scroll area, and hides a run-out button.
- Open PR #7906 makes disabled Buttons focusable (AST-085). Without this record, a hidden run-out edge button would become an invisible tab stop.

## Decision

- A run-out edge scroll button is hidden, takes no tab stop, and is not exposed to assistive technology; it stays mounted. This is removal under AST-085 FR4, not a disabled control (FR1, AR1).
- When the focused edge button runs out, focus moves to the scroll area without scrolling it (FR2, DEC-1).
- The handoff happens once per edge transition and only while the edge button held focus (FR3).
- Everything else about Carousel stays uncontracted.

## Rejected alternatives

- Moving focus to the opposite edge button: it may also be hidden, and focus would jump across the carousel.

## Claim scope and non-goals

Only edge button visibility, tab order, and the edge focus destination. Scrolling, looping, snapping, fades, and slide semantics are out of scope.

## Evidence and implementation relationship

Current source hides run-out edge buttons with `opacity: 0` and native `disabled`, and hands focus to the opposite button. Conformance aligns the handoff to the scroll area and keeps hidden buttons out of the tab order once Button stops using native `disabled`. No implementation is included.

## Writing rubric results

- R1 narration: none; present-tense rules only.
- R2 research in the record: none.
- R3 evidence naming a change: none; verification names test layers.
- R4 rejected alternatives over one line or outside a decision: one, one line, in DEC-1.
- R5 pull request or issue references remaining: none.
- R6 ruled open questions still listing options: none.

## Scope

- [x] This PR contains specification records only.
- [x] It records observable behavior and preserves equivalent internal implementations.
- [x] Any named internal mechanism is intentionally public, names its dependent caller/system, and explains why an equivalent implementation would not satisfy the contract.
- [x] Verification states the evidence layer and failure signal without prescribing CI job/workflow topology.
- [x] It records one intentional durable decision, not a rescue for a separable tagalong.
- [x] The canonical knowledge owner, affected current claims, and overlapping open work are named; any ownership collision is resolved or called out for human decision.
- [x] Adjacent API, visual, accessibility, composition, and implementation facts remain outside scope unless this exact decision depends on them.
- [x] Public text and artifacts contain no internal Meta context.

## Validation

- `pnpm check:knowledge`
- Prettier
- `git diff --check`

@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.

Thanks, the Button change works: disabled Buttons now stay focusable with aria-disabled, keep focus at the Pagination, Calendar and Lightbox boundaries, and the ButtonGroup docs and DropdownMenu inventory follow-ups are fixed. One change is needed before approval: the Carousel record now current on main (packages/core/src/Carousel/Carousel.spec.md, FR2 and DEC-1) moves focus to the scroll area when the focused edge button runs out, but Carousel.tsx still hands it to the opposite button, and five hand-off tests assert that. Please make the scroll area the receiver for every run-out edge (the code already falls back to it when both buttons run out) and point those tests at the scroller.

[Automated review]

Comment thread packages/core/src/Carousel/Carousel.tsx Resolved

@humbertovirtudes humbertovirtudes 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.

Requesting changes on 3271364246d3427699d730dd34946ee93c4d5731. The earlier ListInput, hidden-Carousel-control, roving-group, applicability, ButtonGroup-doc and DropdownMenu-inventory fixes are credited; they are not repeated as open defects.

  1. MAJOR - Carousel edge focus contradicts the current contract. Carousel.tsx:546-568 still chooses the opposite button when it is enabled. Current component:Carousel FR2/DEC-1 explicitly selects the scroll area for every focused edge-button run-out, without scrolling it; the opposite button is a rejected destination. Use the scroll area consistently, keep the one-transition/focus-elsewhere guards, and update the five handoff tests that currently expect the opposite control. Verify both edges, RTL, snapping, blur and content shrinking to fit through the browser focus path.

  2. Form-entry-list follow-up. Button.tsx:826-838 forwards supported name/value while using ARIA rather than native disablement. new FormData(form, submitter) does not invoke click/key guards. A standalone Chromium native-form probe included intent=save for an ARIA-disabled submitter and omitted it for a native-disabled submitter. Please add a production-Button regression for an enabled versus truly disabled named submitter and preserve AST-085 FR3's submission exclusion without restoring native disabled. That platform probe was not a React Button render; component-level reproduction remains unrun in this review.

AI-assisted source review of the exact head and its respin delta. No fresh component/browser-page/AT certification is claimed.

@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.

Requesting changes: one documentation fix is left. The Button change itself works, and both follow-ups from the last review are fixed.

Disabled Buttons now stay focusable with aria-disabled, keep focus at Pagination's last page and in a closing BottomSheet, and leave their value out of FormData; a ButtonGroup or Toolbar of disabled controls keeps one Tab stop.

  • Miss: packages/core/src/IconButton/IconButton.doc.mjs:58 and :252 still say a disabled IconButton uses aria-disabled only when a tooltip is present, but IconButton renders through Button, so every disabled IconButton is now aria-disabled and focusable; please give both rows the wording Button.doc.mjs:154 and :433 now use ("Uses aria-disabled instead of native disabled so the button stays focusable.").

The required pr-a11y check is red only because its browser-spec job reached the 15-minute limit after 440 of 682 tests, all passing; it needs a rerun.

[Automated review]

Comment thread packages/core/src/Button/Button.doc.mjs Resolved

@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: no test failed on this head, but the test and pr-a11y checks are red because two accessibility jobs stopped at their time limits (Component accessibility contracts after 466 of 488 tests, which passed on the previous revision with the same code, and the browser specs after 472 of 682), so they need a rerun before this can merge.

Disabled Buttons now stay focusable as aria-disabled="true", keep focus at Pagination's last page and in a closing BottomSheet, leave their value out of FormData, and ButtonGroup and Toolbar keep one Tab stop when every control is disabled. The IconButton docs follow-up from the last review is fixed: its isDisabled rows now describe the focusable aria-disabled shape.

[Automated review]

DateTimeInputTouch.test.tsx: main's getOnlyButton query, with this
branch's aria-disabled assertions.
@cixzhang

cixzhang commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

/approve-spec af1c252

@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. Two CI jobs need a rerun before the required checks can pass, so this is not ready to merge yet.

Disabled Buttons now stay focusable as aria-disabled="true", keep focus when they become disabled, and still block clicks, Enter and Space, as AST-085 and the Button spec require; in Chromium, Pagination's next-page button and Calendar's Next month keep focus at the last page and month instead of dropping it to the page body. ButtonGroup and Toolbar keep a single Tab stop when every control is disabled, and a disabled named submit Button stays out of FormData.

  • Component accessibility contracts failed one Banner test that timed out loading a story (Banner is unchanged here and the same story loads in its own test), and the pr-a11y browser specs job stopped at its 15-minute limit with no failing test; rerunning both should clear them.

[Automated review]

@cixzhang

cixzhang commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 6158f6d

@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.

Changes requested. The Button change itself works: disabled Buttons stay focusable as aria-disabled="true", keep focus at Pagination's last page and Calendar's max month instead of dropping it to the page body, and a disabled named submit Button stays out of FormData. The latest merge of main brought in two Carousel snap-paging tests that still read the native disabled property this change retires, so the required test check fails on this head.

  • Regression: packages/core/src/SnapPaging/SnapPaging.test.tsx:275-296 reads start.disabled and end.disabled on Carousel's edge Buttons, which are now always false, so two tests fail in test-ui; read getAttribute('aria-disabled') === 'true' instead, and all 11 tests pass.
  • Regression: packages/core/src/Carousel/__tests__/CarouselSnapPagingEdges.interaction.browser.spec.ts:79-80 samples (button as HTMLButtonElement).disabled, so both proofs fail at lines 148 and 177 in Chromium and WebKit; sample aria-disabled the same way.

[Automated review]

Comment thread packages/core/src/Carousel/Carousel.tsx Resolved
…abled

Main's snap-paging edge tests read the native disabled property. A
disabled Button now stays focusable and sets aria-disabled instead, so
the tests read that.
@cixzhang

cixzhang commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

/approve-spec c843c4a

@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. Disabled Buttons now stay focusable as aria-disabled="true", keep focus at Pagination's last page and Calendar's max month instead of dropping it to the page body, keep a disabled ButtonGroup or Toolbar at one Tab stop, and leave a disabled named submit Button out of FormData. The two Carousel snap-paging tests that still read the native disabled property now read aria-disabled, and every CI check on this head passes, the snap-paging browser proofs in Chromium and WebKit included.

One optional cleanup: the Scroll left and Scroll right comments in Carousel.tsx (lines 796-799 and 838-839) still open by restating isDisabled={!canScrollStart}; keeping only the reason (the button stays mounted so the layout does not shift) would be enough.

[Automated review]

@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 7, 2026
@cixzhang
cixzhang merged commit 4e6e67d into meta:main Nov 7, 2026
78 checks passed
vjeux added a commit to vjeux/astryx that referenced this pull request Nov 7, 2026
Main's disabled Button change (meta#7906) and this branch's disabled
handle case edit adjacent lines of ListInput.test.tsx. The resolution
keeps main's aria-disabled assertion for Add and this branch's handle
assertions.

This branch was successfully deployed

1 active deployment
Preview — c843c4a0 Deployed Nov 7, 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] Button/IconButton: native disabled drops focus and hides disabled actions from keyboard users

3 participants