Repository navigation
fix: treat items disabled by a fieldset as disabled - #43
Merged
Merged
Conversation
keyrove read "disabled" only from an element's own `disabled` attribute, so a button inside `<fieldset disabled>` stayed in the item sequence. Every arrow move onto it was refused by focus() and became a consumed no-op, so the items after it could not be reached, typeahead matched it, a focus key declared on it swallowed the key, and initRovingTabindex could give it the stop. An element is now disabled when it carries `disabled` or matches `:disabled`. The item sequence, the navigable test, the stop holder and the focus-key filter all use the same check. `aria-disabled` still does not count. A focusable non-control inside a disabled fieldset stays an item, since `:disabled` matches only form controls.
mixedrays
marked this pull request as ready for review
November 6, 2026 14:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This brings the task 036 fix (a47c158) into
develop. #42 merged it intomainonly. The commit is unchanged, and it is the branch's only commit ahead ofdevelop.A control inside
<fieldset disabled>matches:disabledbut doesn't have its owndisabledattribute. keyrove checked only the attribute, so the control stayed in the item sequence. Each arrow move onto it was refused byfocus()and ended as a consumed no-op, so arrows couldn't reach the items after it.disabledattribute still counts on any element, such as<li disabled>.<div tabindex="-1">, is still an item.aria-disabledstill doesn't count.GLOSSARY.md,docs/glossary.md,docs/api.md(Prettier re-padded its attribute table),examples/skipped-items.md,examples/typeahead.md, and thetypes.tsdoc comments.Evidence
Before: the new jsdom tests against the old
group.tsandconfig.ts: 6 of 7 fail. The seventh is a guard for the<div tabindex="-1">case and passes either way.After: library 561/561, bench 19, docs 19, browser suite 21, typecheck and Prettier all pass.
Benchmark (
pnpm bench:headless, M1 Pro, Chrome 156 headless): +4.7% geometric mean across keyRove cases, unbound keys unchanged, at most about 1 µs more per bound keypress. Full numbers are in fix: treat items disabled by a fieldset as disabled #42.Merge Danger
Door: two-way
The change is one predicate with no stored state, and merging into
developcuts no release.mainalready has a47c158, so the nextdevelop→mainmerge sees the same commit and doesn't conflict over it.Blast Radius: behavioural
<fieldset disabled>leave the item sequence. Arrows, Home/End, typeahead and focus keys skip them, as the README already promised.disabledattribute.developbefore this merges don't have the fix.🤖 Generated with Claude Code