Skip to content

fix(ui): check segmented options on keyboard navigation - #4163

Merged
yannickmonney merged 2 commits into
mainfrom
fix/segmented-control-radio-keyboard
Oct 4, 2026
Merged

yannickmonney merged 2 commits into
mainfrom
fix/segmented-control-radio-keyboard

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

What changed

SegmentedControl now checks the option Radix focuses on ArrowRight/Left/Up/Down, Home or End. It preserves ordinary focus and Tab entry, one roving Tab stop, click/Space/Enter behavior, always-selected state and visual classes. Optional per-option disabling delegates to Radix so navigation skips disabled options.

Radix defers focus to a timer. Navigation intent remains active through that focus task, and each key gets an identity so an older reset cannot clear a newer key’s intent. Independent Chromium review reproduced that race in the initial implementation: Right focused and checked Failed, then Left focused All while Failed remained checked. The added browser regression deterministically exercises the legal timer ordering that caused it.

The website regression verifies that ArrowRight from All checks Failed, requests failed pages from offset 0 and replaces the displayed indexed page. Both website consumers’ callbacks remain unchanged. KNOW-F36’s automation register records the component and browser proof.

Verification

  • Original shared-control regression failed before the implementation: focus moved while aria-checked stayed false. The new real-Chromium race regression also failed on the initial PR head and passes after the guarded reset.
  • Final focused checks: Chromium regression 1/1, shared component unit tests 9/9, complete @tale/ui typecheck, changed-file type-aware lint, formatting and manual register.
  • A separate local Chromium 145.0.7632.6 fixture imported the exact component and used real keyboard/pointer input. All eight navigation/wrapping cases passed, together with one Tab stop, no selection on ordinary focus, Space/Enter, disabled option/group behavior and controlled synthetic page switching; no page errors.
  • React Doctor 0.9.14 scanned both changed TSX files: no issues. Normal commit hooks passed conflict-marker, formatting, configured staged SAST and commitlint checks.
  • The initial PR head’s CI ran the shared component and website suites uncached (9 and 21 tests); final-head CI is pending. Local author verification also covered both website consumers (44/44).

The new focused checks reused retained dependencies without installs or a platform stack. The local unit run used a notes-only Vite allowlist for that isolated checkout’s shared dependency path. Retained Vitest 4.1.11 / browser 4.1.10 emit a version warning; the race also reproduced independently of Vitest in standalone Chromium. The browser fixture is component-level with a synthetic consumer; it does not claim a full live WebsiteViewDialog or visual/screen-reader review. Full final CI remains required before merge.

No UI strings, locale catalogs, migrations, security boundaries or visual classes changed.

Closes #4069

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Independent review of f9c91215151ada5f32978a2ac0063ffc41866464 found a merge-blocking keyboard race in Chromium. The source and hosted jobs look sound in isolation, but the new keyboard cases run under jsdom; the existing green Browser job does not cover this component's repeated native key timing.

With real keyboard input, navigation can leave focus on one option while another remains checked. A deterministic reproduction preserves this legal callback order: ArrowRight; execute its deferred focus (Failed is selected); ArrowLeft; execute the prior ArrowRight reset; execute ArrowLeft's deferred focus. Focus ends on All while Failed remains checked. The older zero-delay reset clears the newer key's intent before Radix handles focus. Unmodified timing also reproduced the mismatch twice.

A bounded local fix and Chromium regression are in progress in an isolated review checkout. Please hold merge and avoid duplicate repair until that exact-head evidence is posted. No production worker or deployment was started; the current maintenance hold remains in effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(ui): SegmentedControl's radios move focus on arrow keys without checking

1 participant