Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 2e28665 |
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
Thanks for closing the RadioList gap: disabled radios now take focus and announce as disabled, and the arrow-key skip and Tab entry behave as the updated records describe. Three issues need fixing before this can be approved:
- A required RadioList whose options are all
isDisabled, with nothing selected, now blocks its form and moves focus to a disabled radio; keepingrequiredoff disabled radios (RadioListItem.tsxline 336) restores native behavior. - With
form="", two disabled RadioLists that share anhtmlNamein different forms become one native radio group, so one loses its checked state and its Tab stop; naming detached radios with a name unique to their group (line 335) keeps them apart. - The selected-disabled registration is a layout effect that sets RadioList state after a first render that leaves the radio in the form; please decide the detachment during render, or name the external system the effect synchronizes, as the React runtime architecture asks (lines 285-289).
[Automated review]
A selected, individually disabled radio stays in its form and its value leaves the submitted entries through the form's formdata event, so the first render is final. A disabled radio is not required. Detached radios take a name unique to their group, so disabled groups that share a field name in different forms stay apart. Real-browser spec and fixtures for the submitted entries.
|
/approve-spec c531b76 |
…lue matching no option is no selection WebKit does not mirror horizontal arrows in a right-to-left radio group, so predicting the browser's next radio landed on a disabled option there. In a group with any disabled radio RadioList now moves every arrow itself; a group without one keeps the browser's arrows. The Tab entry correction now runs whenever no radio is checked, including a value that matches no option. The changeset names the old and new behavior and its accessibility target.
There was a problem hiding this comment.
Thanks for making RadioList's disabled radios reachable: Tab now lands on a group disabled without a reason, focus stays put when a group is disabled, and the focus ring shows. Approval waits on a spec decision, because this head rewrites RadioList FR2, FR4 and FR5 and RadioListItem FR6 (the generated name for a disabled group, scripted arrow-key skipping and Tab entry, and a selected disabled radio that stays in its form with its value removed only after hydration) and the earlier /approve-spec comments named earlier commits; an engineering owner records that decision by commenting /approve-spec 870158dd5c95573d9c96cc10a7cf5b7eb30ac521 on this pull request, and the author may do so if they are an engineering owner. Independently of that decision, these still need changes:
- Server-rendered markup submits a selected, individually disabled option's value until hydration, against AST-085 FR3 (
RadioListItem.tsxlines 286-305). - In WebKit right to left, ArrowRight lands on a disabled option and ArrowLeft jumps the other way, because the skip assumes the engine mirrors horizontal arrows (
RadioList.tsxlines 111-123 and 436-473). - A
valuethat matches no option lets Tab land on a disabled first option (RadioList.tsxline 372), and the changeset should name the accessibility target it serves (AST-017 FR53).
[Automated review]
| // value leaves the entry list, as a natively disabled radio's would | ||
| // (spec:AST-085 FR3). | ||
| const excludesValue = isItemDisabled && isChecked && !context.isDisabled; | ||
| useEffect(() => { |
There was a problem hiding this comment.
This effect is the only thing that keeps a selected, item-disabled radio's value out of the form, so server-rendered markup submits it until hydration: FormData over the server-rendered fixture gives delivery=express, order=1001 here and order=1001 on the base. AST-085 FR3 says a disabled field contributes no value; deciding the exclusion in the rendered markup, or an AST-085 amendment for the pre-hydration window, would close it, and the changeset should say so either way.
|
/approve-spec e3199d5 |
There was a problem hiding this comment.
Changes requested: disabled RadioList radios are meant to stay reachable by keyboard and announced as disabled, and the rewritten RadioList and RadioListItem records are approved at this head, but the head does not load and four things need fixing.
- Regression:
RadioList.tsx:97still callscreateContext, which the merge with main removed from the imports, so importing RadioList or@astryxdesign/corethrowsReferenceError: createContext is not defined; create the context withcreateLayerScopedContext('RadioListFormContext', 1, null)asRadioListContextdoes. - Before hydration an individually disabled option can be checked by a click and is then submitted, and a selected one is submitted from the server markup (
delivery=express), which contradictsspec:AST-085FR2 and FR3; amend AST-085 in this pull request to scope that window, or keep the value out of the submission in markup. - The 119 files under
packages/core/src/i18n/generated-english/are generated output that.gitignoreandarchitecture:internationalizationkeep out of version control, so remove them from the branch. - The changeset says a disabled radio submits no value, and the description still describes native
disableduntil hydration and 286 passing tests, while this head submits a disabled option before hydration and its RadioList tests do not load; update both to match the code.
With the import fixed, the RadioList suite passes locally.
[Automated review]
…her contexts Main now builds Core's contexts through the layer-scoped shared factory, so two copies of Core's modules share one context. The form context follows it, and the browser spec imports Playwright through the a11y-spec wrapper.
|
/approve-spec 6ff2be9 |
There was a problem hiding this comment.
Changes requested: disabled RadioList radios now stay reachable by keyboard and are announced as disabled under the approved RadioList and RadioListItem records, but the three issues from the last review still stand, and CI found one more.
- Before the page hydrates, a click checks an individually disabled option and a form then submits it, and a selected disabled option is submitted straight from the server markup (
delivery=express), which contradictsspec:AST-085FR2 and FR3; amend AST-085 in this pull request to scope that window, or keep the value out of the submission in markup. - Found by CI: the required
lintcheck fails because the new comments inRadioList.tsxandRadioListItem.tsxcitespec:AST-085and its FR numbers beyond the comment-provenance baseline, so drop those citations and keep the reasons. - The 119 files under
packages/core/src/i18n/generated-english/are generated output that.gitignoreandarchitecture:internationalizationkeep out of version control, so remove them from the branch withgit rm -r --cached packages/core/src/i18n/generated-english. - The changeset says a disabled radio submits no value, and the description says it renders native
disableduntil hydration and can't be selected or submitted, while this head lets an individually disabled option be checked and submitted before hydration; update both to match the code.
The RadioList tests and the core typecheck pass at this head; CI's other test and build jobs were still running when this review was written.
[Automated review]
…d English, and qualify the changeset The comment-provenance rule allows only baselined sites, so the new comments keep their reasons without citing AST-085. The generated English files are build output the ignore file covers. The changeset says an individually disabled option can be checked and submitted until hydration, and names the WCAG targets.
…sites this change removed
|
/approve-spec 82ec94d |
There was a problem hiding this comment.
Changes requested: disabled RadioList radios now stay reachable by keyboard and are announced as disabled under the approved RadioList and RadioListItem records, and the lint, generated-file and changeset issues from the last review are fixed. One issue remains.
- Before the page hydrates, a form submits a selected, individually disabled option (
delivery=express), and a click or ArrowDown checks an unselected disabled option that is then submitted, which contradictsspec:AST-085FR2 and FR3; recording the window in the RadioList records does not amend AST-085, so amend AST-085 FR2 and FR3 in this pull request to scope the pre-hydration window, or keep the value out of the submission in markup.
Two smaller points are in the inline comments: the before-hydration notes leave out that a click also checks a radio in a wholly disabled group, and two comments were left broken when their citations were removed. CI has not run on this head yet.
[Automated review]
…s click too, and two comments reflow A click checks a radio of a wholly disabled group in server markup as well, against AST-085 FR2, though that group submits nothing. Two comments left broken by the citation removal are joined and reflowed.
There was a problem hiding this comment.
Approval waits on an engineering owner: the last commit rewords RadioListItem FR6 and the pre-hydration notes in both records, so the rewritten RadioList and RadioListItem records need a spec approval at this head. An engineering owner records it by commenting /approve-spec 38ee57cf1715b9e9b485bee76895626c28e4af7e on this pull request; the author may do so if they are an engineering owner.
- Before the page hydrates, a click or an arrow key checks a disabled option and a form submits a checked, individually disabled one (
delivery=expressfrom server markup), which contradictsspec:AST-085FR2 and FR3; describing the window in the component records does not amend AST-085, so amend AST-085 FR2 and FR3 in this pull request or keep the value out of server markup.
The earlier notes on the wholly disabled group's pre-hydration click and the two broken comments are fixed. Two non-blocking comment notes are inline.
[Automated review]
| // is not silenced by the browser, so drop the handler here | ||
| // (`spec:AST-085` FR2), as CheckboxInput does. | ||
| // to the input — the same routing CheckboxListItem uses. | ||
| // A disabled radio runs no caller onClick. |
There was a problem hiding this comment.
Non-blocking, missed in the last review: this line restates onClick={isDisabled ? undefined : onClick}. Keep only the reason, for example // The browser does not silence an aria-disabled radio, so drop the handler.
| // from submission, matching a natively disabled control. | ||
| form={keepsFocusableForMessage ? '' : undefined} | ||
| required={context.isRequired} | ||
| // A disabled radio stays focusable, in server |
There was a problem hiding this comment.
Non-blocking, missed in the last review: this line breaks after "in server" at 54 characters, left by the removed citation. Join it with the next line and reflow the comment.
|
/approve-spec 38ee57c |
There was a problem hiding this comment.
Changes requested: once the page hydrates, disabled RadioList radios are reachable by keyboard, announced as disabled, skipped by the arrow keys and left out of the submission, and the RadioList and RadioListItem record changes are owner-approved for this head. One defect remains:
- Before the page hydrates, a click or an arrow key checks a disabled option, and a form submits a checked, individually disabled one (the server markup submits
delivery=express, anddelivery=overnightafter a click on the disabled Overnight), which contradictsspec:AST-085FR2 and FR3; the component records describe this gap but do not amend AST-085, so either amend AST-085 FR2 and FR3 in this pull request or keep the value out of the server markup.
One new non-blocking comment note is inline; the two comment notes from the last review still apply.
| * Arrow keys skip individually disabled options. The browser's radio group | ||
| * would move onto an `aria-disabled` radio, so in a group with any disabled | ||
| * radio every arrow move goes through the shared list focus, as | ||
| * SegmentedControl's does: focus goes to the next available radio in the | ||
| * same direction (the inline-end arrow forward, mirrored in right-to-left), | ||
| * wrapping as the native group does, or stays put when there is none, and | ||
| * the radio it lands on is selected. Owning every move, not only the ones | ||
| * that would land on a disabled radio, keeps one direction rule in every | ||
| * engine (WebKit does not mirror horizontal arrows in right-to-left). A | ||
| * group with no disabled radio keeps the browser's own arrow keys. |
There was a problem hiding this comment.
Non-blocking, missed in earlier reviews: the second sentence of this JSDoc runs about 70 words and joins four topics. Shorter sentences keep only the reason, for example: "The browser's radio group moves onto an aria-disabled radio. In a group with a disabled radio, the shared list focus moves every arrow key, skips disabled radios and wraps. RadioList owns every move, because WebKit does not mirror horizontal arrows in right-to-left."
Part of #7817 (the RadioList half; the other choice controls shipped in #7824)
User impact
Keyboard and screen-reader users can't reach a RadioList that is disabled without a
disabledMessage. Its radios render the nativedisabledattribute, so Tab skips the whole group and a screen reader moving by focus never hears that the question exists or that it's locked. In a settings form with a locked "Delivery speed" choice, a keyboard user sees one question fewer than everyone else.After this change a disabled radio is reachable and announced as disabled, with or without a reason. It still can't be selected or submitted. Arrow keys keep skipping an individually disabled option, as they do today.
Problem and solution fit
disabledunless the whole group has adisabledMessage, and the browser takes natively disabled radios out of the tab order.spec:AST-085removed from every other choice control. RadioList was split out of that fix only because its arrow-key rule wasn't decided yet; RadioList's record now decides it (see below).The fix replaces native
disabledwitharia-disabledand keeps the native radio group whole: one name, one form owner, one Tab stop. The browser keeps handling arrow keys, except that a move onto a disabled option goes on to the next enabled one.Expected behavior and authority
spec:AST-085FR1–FR4, FR6 and FR7: no nativedisabled;aria-disabledwith the enabled focus order; every change path blocked; no submitted value and no blocked submit; focus kept when a control becomes disabled; the focus indicator still shows.component:RadioListFR4/FR5 andcomponent:RadioListItemFR6/FR7, as amended here for consistency: AST-085 leaves arrow-key visiting to the composite, and RadioList keeps skipping individually disabled options (the ButtonGroup FR8, Calendar and shared list-focus precedent). A disabled option takes focus by Tab only when it is the group's Tab stop (the selected option, or a wholly disabled group).Smallest restoration
RadioListItem
aria-disabled="true"replaces nativedisabled.onClick.Submission (FR3), decided at render, so the first render is final:
form=""). Its radios take the group's internal name instead ofhtmlName(they submit nothing), so two disabled groups sharing a field name in different forms stay apart. RadioList FR2, its Name concept, thehtmlNamedocs and the changeset say so.required. Its value leaves the submitted entries through the form'sformdataevent, an effect that installs and removes one listener on the form owner.required, so a required group whose options are all disabled blocks no submit. One enabled option keeps the choice required.Keyboard (FR4)
useInternalListFocus, as SegmentedControl's does. It moves focus to the next enabled radio in that direction (the inline-end arrow forward, mirrored in RTL), wrapping as the native group does, or stays put; RadioList selects the radio it lands on. Owning every move keeps one direction rule in every engine (WebKit doesn't mirror horizontal arrows in RTL).onKeyDownruns first and can opt out withpreventDefault.Before hydration: server markup carries no native
disabledeither, so a disabled radio is focusable before hydration too (spec:AST-085FR1).form=""in server markup, so it submits nothing before hydration.spec:AST-085FR2 and FR3 only once hydrated.Docs: RadioList's docs and the
disabledMessageJSDoc no longer say disabled controls swallow hover events. The reason now also describes each radio.Not in this PR
Merged with main
aria-disabled, form detach and droppedrequiredon a disabled radio, and takes main's reason description and status-followingaria-invalid.aria-invalidand that a disabled radio dropsrequired.Evidence
Real Chrome 156 (headless, DPR 2), Storybook built from
mainat 6162917 and from this branch, served locally. The same keyboard probe ran each disabled state of the radio-group a11y stories: Tab from the page start, then the arrow keys.mainaria-disabled, focus ring shownaria-disabledaria-disabledIn every state the disabled radios on this branch carry
aria-disabledand nodisabledattribute.Regression tests:
RadioList.focusableDisabled.test.tsx, 21 cases. 10 fail onmain:disabledon an item-disabled option and on a group disabled without a reason;The remaining 11 guard paths the new implementation could break:
onChangeoronClick;onKeyDownstill runs;RadioListDisabledForm.interaction.browser.spec.ts: real-browser proof of the submitted entries (jsdom fires noformdataevent), over three no-visual fixtures. The same checks in real Chrome 156 on this head:checkValidity()orderfieldorder=1001onlydeliveryin two formsThe radio-group a11y binding now expects
radio-list-option-group-disabledto be reached by Tab.Scope
Testing
pnpm vitest runfor RadioList and Field on the merged head: 286 pass (earlier, before the merge: RadioList, SegmentedControl, CheckboxList, Field and Form, 415 pass).tsc --noEmitfor core, eslint, prettier,pnpm check:knowledge,pnpm check:changesets.mainversus this branch.Writing rubric results
Credit
@korkt-kim also proposed keeping a disabled radio focusable and inert in #9301, which is now closed. The changeset credits it.
Co-authored-by: korkt-kim [email protected]
Owner: fix-loop lane 4. Land path: Held for the owner's input-hardening decision; then the remaining review fix, CI, and the drain merges.