Repository navigation
Conversation
commit: |
Bundle size
PerformanceNo regressions in 36 benchmarks · ran 2m 30s · details Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
…ite item Revert the useCompositeRoot change so the shared composite code is untouched. RadioRoot now sets the active composite item marker only when the radio is checked and not disabled, so a disabled checked radio no longer holds the group's tab stop and the composite falls back to the first enabled radio.
PR reviewOne merge-blocking keyboard regression. The initial-render fix works, but the tab stop is only chosen when the radios first register, so a checked radio that becomes enabled later never gets it back. Reproduced in Chromium with real Tab presses against the PR head and its base. Bugs (1)1. 🔴 Enabling the checked radio after mount leaves the group out of the tab orderLocation: [ACTIVE_COMPOSITE_ITEM as string]: checked && !disabled ? '' : undefined,
The second row is the known limitation from the PR description and also fails on the base commit. The first row is new. Failure scenario: Radios are disabled while availability loads, and the checked option then becomes available. With Fix: Sync the tab stop when the radio becomes checked and enabled, the way VerdictRequest changes - a realistic disabled → enabled transition now takes the radio group out of the tab order. 🤖 Review generated with Claude Code |
…abled The composite only reads ACTIVE_COMPOSITE_ITEM when its items first register, so a checked radio that was disabled at mount never got the tab stop back once enabled. Sync the highlighted index when a radio becomes checked and enabled, unless focus is already inside the group.
|
Fixed in 8a8f3c4: a radio that becomes checked and enabled after mount now takes the tab stop back, unless focus is already inside the group, and the native Tab test covers the disabled to enabled case. Row 2 (disabling the checked radio after mount) is still the known limitation from the description, since this change only handles a radio becoming enabled. |
Fixes #6179
When the checked radio in a
RadioGroupis disabled, it held the group's single roving tab stop. WithnativeButton, a disabled<button>leaves the tab order, so the whole group could not be reached with Tab.RadioRootnow marks itself as the active composite item only when it is checked and enabled, similar to howTabsTabavoids highlighting a disabled tab. The composite then uses its existing fallback and puts the tab stop on the first enabled radio. The shared composite code is not changed.Behavior:
readOnlychecked radio: keeps the tab stopdisabled: unchanged, every radio hastabIndex -1Tests include a real Tab-key test with
nativeButton.Note: this reverses the test added in #6022 ("keeps the tab stop on a checked radio that is disabled"). Could a maintainer confirm this is the intended behavior?
Known limitation (also on master): if the checked radio becomes disabled after mount, it keeps the tab stop. Happy to open a follow-up for that.