Skip to content

spec(AST-085): disabled controls stay focusable - #7793

Merged
cixzhang merged 6 commits into
mainfrom
spec/ast085-focusable-disabled
Oct 21, 2026
Merged

cixzhang merged 6 commits into
mainfrom
spec/ast085-focusable-disabled

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Exact decision needed

Whether Astryx disabled controls may leave keyboard focus, and what happens when the control a user is on becomes disabled.

Existing authority searched

  • family:buttons FR3 (current): disabled blocks activation and MAY use focusable aria-disabled when a reason needs focus.
  • family:input-fields FR4 (current): a field with disabledMessage stays "focusable enough" to expose the reason.
  • spec:AST-011 FR5 (current): disabled focus, paint, and submission win over read-only. Unchanged.
  • component:DateRangeInput AR3 and component:Tokenizer (current) named native disabled; amended here. Draft records for ClickableCard, BaseTypeahead, CheckboxInput, ChatComposer, and CommentPin describe it as observed behavior and do not govern.
  • architecture:interaction-modality INV1/INV5 (current): keyboard focus visibility and disabled non-interactivity.
  • spec:AST-009 FR2: focus destination needs browser evidence, not real-AT evidence.
  • Shipped code: Button already keeps focus via aria-disabled for busy and tooltip cases; TextInput and CheckboxInput do so with a disabled reason. Pagination, Calendar, Lightbox, and the touch date pickers render native disabled on boundary arrows, so keyboard focus falls to the document body at the first or last page, month, or item.
  • No current claim requires native disabled, and none decides what happens to focus when a focused control becomes disabled.

Decision

  • Components never render the native disabled attribute. Disabled controls expose aria-disabled="true" and keep their enabled focus order.
  • Disabled blocks every value change, activation, navigation, surface opening, and callback.
  • Disabled values are not submitted and do not block constraint validation, matching native form behavior.
  • A control that becomes disabled while focused keeps focus unless the component's own record names a destination inside the component.
  • Disabled state, name, and reason are exposed on the focusable element; disabled paint stays, hover and pressed affordances do not, and the keyboard focus indicator still shows.
  • Group and form-level disablement follow the same rule.
  • family:buttons FR3 and family:input-fields FR4 link to this record instead of carrying a weaker local rule.
  • component:DateRangeInput (disabled presets, AR3) and component:Tokenizer (disabled state and its verification) no longer name native disabled; they follow this record.
  • Disabled paint keys on the disabled state, so a busy Button keeps its pending treatment (family:buttons FR4).

Rejected alternatives

  • Moving focus to a component-chosen fallback whenever a control becomes disabled: every component needs its own destination and timing, and focus still jumps.

Claim scope and non-goals

Which items arrow keys visit inside a composite widget, read-only behavior, disabled paint and theme states, and elements a caller renders inside a slot stay with their existing owners.

Overlapping open work

Evidence and implementation relationship

Keyboard reproduction in Chromium: focus reaches the document body after the boundary press in Pagination, Calendar, Lightbox, and the touch DateInput picker. No implementation is included. Conformance work follows separately; consumers who select disabled controls with :disabled, query them with toBeDisabled(), or rely on Tab skipping them see a change, which release notes will name. Affected consumer docs (Button, ClickableCard, Collapsible, TextInput, TextArea, NumberInput, useInteractiveRole) and native-disabled test cases in DateRangeInput and Slider are named in the record and change with conformance work.

Writing rubric results

  • R1 narration: none; the record states present-tense behavior. The family and component edits are present-tense cross-references.
  • R2 research in the record: none.
  • R3 evidence naming a change: none; verification cites test and browser layers.
  • R4 rejected alternatives over one line or outside a decision: one, one line, inside DEC-1.
  • R5 pull request or issue references remaining: none in the new record or the edited family lines.
  • R6 ruled open questions still listing options: none; open questions section reads "None".

Scope

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

Validation

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

@vercel

vercel Bot commented Oct 21, 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 Oct 21, 2026 5:11pm UTC

Request Review

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

astracat-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 21, 2026, 5:36 PM UTC

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 48d89c1

@github-actions github-actions Bot added the spec-auto-merge Auto-merge was enabled by the spec owner gate label Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

View Storybook for this PR · View Sandbox for this PR

Current run: The current change has no visual or preview-producing scope. Visual checks are not applicable; preview links are not shown.


Generated by PR Enrichment workflow | View current CI run

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

This new disabled-controls rule needs a maintainer's decision before it can be approved: spec:AST-085 FR1–FR7 and the rewrites of family:buttons FR3 and family:input-fields FR4 are new normative requirements, and the only approval so far is the author's own /approve-spec. Whatever that decision is, two fixes are also needed:

  • FR1 forbids native disabled, but the current DateRangeInput record (AR3, constraint-violating presets) and the Tokenizer record (its Disabled row and browser-evidence list) still require or allow it; update them in this pull request as was done for the two family records, or narrow FR1.
  • FR6 applies disabled paint whenever aria-disabled="true" is present, which includes busy Buttons and contradicts family:buttons FR4 (pending and disabled styling stay distinct); key it to the disabled state instead.

[Automated review]

Comment on lines +43 to +44
- **FR1 — Disabled controls stay focusable.** A component MUST NOT put the
native `disabled` attribute on any element it renders. A disabled control

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.

This prohibition contradicts two current component records that this pull request leaves unchanged: the DateRangeInput record's AR3 says a constraint-violating preset "remains natively disabled", and the Tokenizer record allows "Native-disabled or focusable-disabled representation". Please amend those records here, as was done for the two family records, or narrow FR1.

Comment on lines +63 to +64
- **FR6 — Disabled stays visibly inert.** Disabled paint applies whenever
`aria-disabled="true"` is present. Hover, pressed, and drag affordances MUST

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.

Keying disabled paint to the attribute also catches busy Buttons: Button sets aria-disabled="true" while a fire-once action is pending, without disabled paint, and family:buttons FR4 keeps pending and disabled styling distinct. Tie this to the disabled state (isDisabled, a group or a form default) instead, or exempt busy-only aria-disabled.

@cixzhang
cixzhang force-pushed the spec/ast085-focusable-disabled branch from 48d89c1 to 967f12e Compare October 21, 2026 14:09
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 967f12e

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

This is close, but it needs one more record change before approval. spec:AST-085 FR1 says a disabled control keeps the Tab stop it has when enabled, while the current Slider record (AR1) still makes a disabled thumb a Tab stop only when it carries a disabled message, which is how Slider ships today (Slider.tsx:966). Please amend Slider AR1 and name Slider in Current-state impact, as this head does for DateRangeInput and Tokenizer, or narrow FR1.

[Automated review]

- **FR1 — Disabled controls stay focusable.** A component MUST NOT put the
native `disabled` attribute on any element it renders. A disabled control
exposes `aria-disabled="true"` and keeps the focus order it has when enabled:
a tab stop stays a tab stop, and an element with `tabIndex={-1}` stays out of

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.

This keeps a disabled Slider thumb in the Tab order, but the current Slider record's AR1 still says only “an enabled thumb, and a disabled thumb that carries a disabled message, is a Tab stop”, which is how Slider ships today (Slider.tsx:966). Please amend Slider AR1 and add Slider to Current-state impact here, as this head does for DateRangeInput and Tokenizer, or narrow FR1.

@cixzhang
cixzhang force-pushed the spec/ast085-focusable-disabled branch from 967f12e to cf3d7f5 Compare October 21, 2026 14:53
@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed spec-auto-merge Auto-merge was enabled by the spec owner gate labels Oct 21, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec cf3d7f5

@github-actions github-actions Bot added spec-auto-merge Auto-merge was enabled by the spec owner gate and removed needs:spec-owner-review Current knowledge records await owner approval labels Oct 21, 2026

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

The new disabled-controls rule has an engineering owner's approval for this revision and no current spec conflicts with it, but two record fixes are needed before it merges.

  • affects_consumer_docs is empty and Current-state impact names no docs, yet the Button, ClickableCard, Collapsible, TextInput, TextArea, NumberInput and useInteractiveRole docs still describe disabled controls as natively disabled or out of the tab order; please list them, and describe Slider as gaining and Selector as keeping a Tab stop rather than leaving native disabled.
  • The DateRangeInput and Slider verification maps still point at tests that assert toBeDisabled() and tabindex="-1"; please mark those cases pending conformance.

Open #6304 fixes the same focus loss by moving focus to a fallback, which DEC-1 rejects, so it is worth naming here so its author can be redirected.

[Automated review]

affects_architecture: [architecture:interaction-modality]
affects_families: [family:buttons, family:input-fields]
affects_contributing: []
affects_consumer_docs: []

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.

FR1 reverses behavior that shipped consumer docs state: Button.doc.mjs:153 (native disabled unless a tooltip is present), ClickableCard.doc.mjs:27 and Collapsible.doc.mjs:75 (out of the tab order), TextInput.doc.mjs:96, TextArea.doc.mjs:154 and NumberInput.doc.mjs:84 (read-only "stays in the tab order" unlike isDisabled), and hooks/useInteractiveRole.doc.mjs:69. Please list them here and name them in Current-state impact.

Comment on lines +86 to +89
- `component:DateRangeInput` AR3 and its disabled-preset state,
`component:Tokenizer`'s disabled state and verification, `component:Slider`
AR1 (every thumb is a Tab stop), and `component:Selector`'s disabled-with-reason
state follow this record instead of native `disabled`.

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.

Slider and Selector do not use native disabled: a disabled Slider thumb leaves the Tab order through tabIndex={-1} (Slider.tsx:966), and Selector's disabled-with-reason trigger is already a Tab stop (Selector.tsx:1895). Describe Slider as gaining the Tab stop and Selector as keeping it.

Comment on lines +123 to +124
a range-span constraint is disabled and stays focusable (`spec:AST-085`); theme
state reflection does not replace that behavior.

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.

The verification map still cites DateRangeInput.test.tsx for AR1–AR3 on endpoint- and span-invalid presets (line 177), and those tests assert expect(preset).toBeDisabled() (DateRangeInput.test.tsx:529, :547, :565), which a focusable aria-disabled preset fails. Please mark this case pending conformance there.

@cixzhang
cixzhang force-pushed the spec/ast085-focusable-disabled branch from cf3d7f5 to b0f855e Compare October 21, 2026 15:33
@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed spec-auto-merge Auto-merge was enabled by the spec owner gate labels Oct 21, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec b0f855e

@github-actions github-actions Bot added spec-auto-merge Auto-merge was enabled by the spec owner gate and removed needs:spec-owner-review Current knowledge records await owner approval labels Oct 21, 2026

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

The disabled-controls rule has an engineering owner's approval for this revision and no current spec conflicts with it, but the record still needs two small fixes before it merges.

  • Add useIndicatorFocusRing, RichTextEditor and CommentPin to affects_consumer_docs and Current-state impact: their docs describe disabled controls as not focusable, out of the tab order, or natively disabled, and the ring hook's isDisabled suppresses the keyboard focus ring FR6 requires (a focused disabled CheckboxInput with a reason shows no ring today).
  • Mark the family:buttons and Tokenizer verification cases that still assert toBeDisabled() as pending conformance, as this revision already does for DateRangeInput and Slider.

[Automated review]

Comment on lines +103 to +105
- Consumer docs for Button, ClickableCard, Collapsible, TextInput, TextArea,
NumberInput, and `useInteractiveRole` describe disabled controls as natively
disabled or out of the tab order; they change with conformance work.

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.

This list misses three shipped surfaces that describe the behavior FR1 and FR6 reverse: useIndicatorFocusRing.doc.mjs:32 ("Skip the ring; a disabled control is not focusable", and the hook skips the keyboard focus ring for a focused disabled CheckboxInput today), RichTextEditor.doc.mjs:88 ("out of the tab order"), and CommentPin.doc.mjs:152 ("removed from sequential focus order"). Please add them here and to affects_consumer_docs.

Comment thread docs/families/buttons.md
Comment on lines +118 to +119
callback or Action. Disabled members stay focusable and follow
`spec:AST-085`. A group disabled state overrides member availability.

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.

The FR1–FR3 verification row and this family's verified_by suites still assert native disabled for disabled members and groups (Button.test.tsx:146, IconButton.test.tsx:119, ButtonGroup.test.tsx:166-167, ToggleButton.test.tsx:848, :883). Please mark those cases pending conformance, as this PR does for DateRangeInput and Slider.

| Focus bootstrap, selected choice was last | The nearest preceding remaining choice becomes active without changing the displayed order. | Option identity representation may vary. |
| Focus bootstrap, no choices or max reached | The popup closes and no active descendant remains; pending work cannot reopen it. | Source cancellation mechanism may vary. |
| Source pending or replaced | Busy semantics identify pending work; stale work cannot add choices or reopen a terminal popup. | A settled current cohort may be retained internally. |
| Disabled | No choice can be committed; an open popup closes and clears its active descendant while disabled-reason focusability remains available where configured. | The disabled representation follows `spec:AST-085`. |

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.

Tokenizer.test.tsx still asserts native disabled (:397, and :1309 "keeps the input natively disabled when disabled without a reason"), and this record's verification map cites those suites for the disabled state. Please mark those cases pending conformance here, as the DateRangeInput and Slider maps now do.

@cixzhang
cixzhang force-pushed the spec/ast085-focusable-disabled branch from b0f855e to a4cf6fe Compare October 21, 2026 16:21
@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed spec-auto-merge Auto-merge was enabled by the spec owner gate labels Oct 21, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec a4cf6fe

@github-actions github-actions Bot added spec-auto-merge Auto-merge was enabled by the spec owner gate and removed needs:spec-owner-review Current knowledge records await owner approval labels Oct 21, 2026

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

The disabled-controls rule has an engineering owner's approval for this revision, no current spec conflicts with it, and the fixes asked for last time landed, but the impact list needs one more pass before it merges.

  • Name BaseTypeahead's public isFocusableDisabled in Current-state impact and say what happens to it: under FR1 every disabled input is already focusable, so the prop stops doing anything, and its documented "Enter can still select the highlighted option" is what FR2 forbids.
  • Add ButtonGroup, whose guidance says "A disabled member drops focus", to affects_consumer_docs and the consumer-docs line, along with the 16 components whose disabledMessage docs say disabled controls swallow the hover events an external Tooltip needs: CheckboxInput, CheckboxList, DateInput, DateRangeInput, DateTimeInput, FileInput, MultiSelector, PowerSearch, RadioList, SegmentedControl, Selector, Slider, Switch, TimeInput, Tokenizer and Typeahead.
  • Optionally, drop "removed from the tab order by default" from spec:AST-011 DEC-1, and say whether a screen reader must hear the change when a focused control turns disabled.

[Automated review]

Comment on lines +107 to +110
- Consumer docs for Button, IconButton, ClickableCard, Collapsible, TextInput,
TextArea, NumberInput, RichTextEditor, CommentPin, `useInteractiveRole`, and
`useIndicatorFocusRing` describe disabled controls as natively disabled, not
focusable, or out of the tab order; they change with conformance work.

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.

This list misses surfaces of the same kind:

  • ButtonGroup.doc.mjs:98 says "A disabled member drops focus, so a keyboard user loses their place" (again at :163).
  • The disabledMessage descriptions of CheckboxInput, CheckboxList, DateInput, DateRangeInput, DateTimeInput, FileInput, MultiSelector, PowerSearch, RadioList, SegmentedControl, Selector, Slider, Switch, TimeInput, Tokenizer and Typeahead end "Disabled controls swallow the hover events an external Tooltip needs" (for example Selector.doc.mjs:276).

Once no component renders native disabled (FR1) and focus stays put (FR4), neither statement holds. Please add these components here and to affects_consumer_docs.

Comment on lines +115 to +117
- Draft records for ClickableCard, BaseTypeahead, CheckboxInput, ChatComposer,
and CommentPin describe native `disabled` as observed behavior; they change
with conformance work.

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.

BaseTypeahead's public isFocusableDisabled (BaseTypeahead.tsx:161) is the only way to keep a disabled BaseTypeahead focusable today (disabled={isDisabled && !isFocusableDisabled}, :1203). Under FR1 it no longer changes anything, and its documented "Enter can still select the highlighted option" (BaseTypeahead.doc.mjs:178) is what FR2 forbids. Please name the prop in Current-state impact with what happens to it (kept as a no-op, deprecated, or removed), and add BaseTypeahead to affects_consumer_docs.

Comment on lines +118 to +119
- `spec:AST-011` FR5 stays true: disabled focus, submission, and paint still win
over read-only.

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.

spec:AST-011 DEC-1 still rejects mapping read-only to isDisabled "because disabled values are dimmed, removed from the tab order by default, and excluded from form submission". FR1 makes the middle clause false. Consider dropping it there, or naming it in this bullet.

Comment on lines +73 to +75
- **FR5 — Disabled state is announced.** The disabled state is exposed to
assistive technology on the focusable element itself, together with its
accessible name and any description or disabled reason.

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.

Nothing says whether a screen reader hears the change when the focused control turns disabled (FR4): FR5 covers the state on the focused element, not the transition. If the announcement is promised, say so, and spec:AST-009 FR3 then asks for real-AT evidence. If it is not promised, say that too.

@cixzhang
cixzhang force-pushed the spec/ast085-focusable-disabled branch from a4cf6fe to cbd584c Compare October 21, 2026 17:02
@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed spec-auto-merge Auto-merge was enabled by the spec owner gate labels Oct 21, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec cbd584c

@github-actions github-actions Bot added spec-auto-merge Auto-merge was enabled by the spec owner gate and removed needs:spec-owner-review Current knowledge records await owner approval labels Oct 21, 2026

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

This looks ready to merge: the disabled-controls rule has an engineering owner's approval for this revision, no current spec conflicts with it, and the impact-list fixes from the previous pass are all in. The component conformance work the record lists can follow in separate pull requests.

[Automated review]

@cixzhang
cixzhang merged commit 7b66913 into main Oct 21, 2026
48 checks passed
@github-actions
github-actions Bot deleted the spec/ast085-focusable-disabled branch October 22, 2026 06:22

This branch was successfully deployed

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

Labels

CLA Signed This label is managed by the Meta Open Source bot. spec-auto-merge Auto-merge was enabled by the spec owner gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant