Repository navigation
spec(AST-085): disabled controls stay focusable - #7793
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 48d89c1 |
PR Analysis ReportView Storybook for this PR · View Sandbox for this PR
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
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 contradictsfamily:buttonsFR4 (pending and disabled styling stay distinct); key it to the disabled state instead.
[Automated review]
| - **FR1 — Disabled controls stay focusable.** A component MUST NOT put the | ||
| native `disabled` attribute on any element it renders. A disabled control |
There was a problem hiding this comment.
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.
| - **FR6 — Disabled stays visibly inert.** Disabled paint applies whenever | ||
| `aria-disabled="true"` is present. Hover, pressed, and drag affordances MUST |
There was a problem hiding this comment.
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.
48d89c1 to
967f12e
Compare
|
/approve-spec 967f12e |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
967f12e to
cf3d7f5
Compare
|
/approve-spec cf3d7f5 |
There was a problem hiding this comment.
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_docsis empty and Current-state impact names no docs, yet the Button, ClickableCard, Collapsible, TextInput, TextArea, NumberInput anduseInteractiveRoledocs 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 nativedisabled.- The DateRangeInput and Slider verification maps still point at tests that assert
toBeDisabled()andtabindex="-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: [] |
There was a problem hiding this comment.
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.
| - `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`. |
There was a problem hiding this comment.
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.
| a range-span constraint is disabled and stays focusable (`spec:AST-085`); theme | ||
| state reflection does not replace that behavior. |
There was a problem hiding this comment.
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.
cf3d7f5 to
b0f855e
Compare
|
/approve-spec b0f855e |
There was a problem hiding this comment.
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,RichTextEditorandCommentPintoaffects_consumer_docsand Current-state impact: their docs describe disabled controls as not focusable, out of the tab order, or natively disabled, and the ring hook'sisDisabledsuppresses the keyboard focus ring FR6 requires (a focused disabled CheckboxInput with a reason shows no ring today). - Mark the
family:buttonsand Tokenizer verification cases that still asserttoBeDisabled()as pending conformance, as this revision already does for DateRangeInput and Slider.
[Automated review]
| - 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. |
There was a problem hiding this comment.
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.
| callback or Action. Disabled members stay focusable and follow | ||
| `spec:AST-085`. A group disabled state overrides member availability. |
There was a problem hiding this comment.
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`. | |
There was a problem hiding this comment.
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.
b0f855e to
a4cf6fe
Compare
|
/approve-spec a4cf6fe |
There was a problem hiding this comment.
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 publicisFocusableDisabledin 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", toaffects_consumer_docsand the consumer-docs line, along with the 16 components whosedisabledMessagedocs 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-011DEC-1, and say whether a screen reader must hear the change when a focused control turns disabled.
[Automated review]
| - 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. |
There was a problem hiding this comment.
This list misses surfaces of the same kind:
ButtonGroup.doc.mjs:98says "A disabled member drops focus, so a keyboard user loses their place" (again at:163).- The
disabledMessagedescriptions 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 exampleSelector.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.
| - Draft records for ClickableCard, BaseTypeahead, CheckboxInput, ChatComposer, | ||
| and CommentPin describe native `disabled` as observed behavior; they change | ||
| with conformance work. |
There was a problem hiding this comment.
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.
| - `spec:AST-011` FR5 stays true: disabled focus, submission, and paint still win | ||
| over read-only. |
There was a problem hiding this comment.
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.
| - **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. |
There was a problem hiding this comment.
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.
…s pending conformance
…nd Tokenizer native-disabled tests pending
…led, AST-011 DEC-1 wording
a4cf6fe to
cbd584c
Compare
|
/approve-spec cbd584c |
There was a problem hiding this comment.
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]
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:buttonsFR3 (current): disabled blocks activation and MAY use focusablearia-disabledwhen a reason needs focus.family:input-fieldsFR4 (current): a field withdisabledMessagestays "focusable enough" to expose the reason.spec:AST-011FR5 (current): disabled focus, paint, and submission win over read-only. Unchanged.component:DateRangeInputAR3 andcomponent:Tokenizer(current) named nativedisabled; amended here. Draft records for ClickableCard, BaseTypeahead, CheckboxInput, ChatComposer, and CommentPin describe it as observed behavior and do not govern.architecture:interaction-modalityINV1/INV5 (current): keyboard focus visibility and disabled non-interactivity.spec:AST-009FR2: focus destination needs browser evidence, not real-AT evidence.aria-disabledfor busy and tooltip cases; TextInput and CheckboxInput do so with a disabled reason. Pagination, Calendar, Lightbox, and the touch date pickers render nativedisabledon boundary arrows, so keyboard focus falls to the document body at the first or last page, month, or item.disabled, and none decides what happens to focus when a focused control becomes disabled.Decision
disabledattribute. Disabled controls exposearia-disabled="true"and keep their enabled focus order.family:buttonsFR3 andfamily:input-fieldsFR4 link to this record instead of carrying a weaker local rule.component:DateRangeInput(disabled presets, AR3) andcomponent:Tokenizer(disabled state and its verification) no longer name nativedisabled; they follow this record.family:buttonsFR4).Rejected alternatives
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 withtoBeDisabled(), 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
Scope
Validation
pnpm check:knowledgegit diff --check