Repository navigation
[toolbar] Fix disabled state and roving focus bugs - #4968
Conversation
commit: |
Bundle size
PerformanceTotal duration: 1,080.82 ms -219.37 ms(-16.9%) | Renders: 50 (+0) | Paint: 1,606.15 ms -353.75 ms(-18.0%)
8 tests within noise — details Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Code Review (GPT-5.5)Approve ✅ The branch fixes the Toolbar disabled/focus regressions at the metadata source, and the added tests fail on freshly fetched 1. Bugs / Issues (None)No branch-relevant bugs, repo-convention issues, or documentation mismatches found in the full Root Cause & Patch AssessmentThe fix addresses the underlying metadata problem rather than only the observed keyboard symptoms: Toolbar items now report both The shared Test Coverage AssessmentValidation run on the PR head:
I also applied the new Toolbar regression tests onto freshly fetched |
This is part of the Codex sweep for Toolbar. It fixes disabled-state and keyboard-navigation bugs found during review and adds focused regression coverage.
Changes
stopEventkeydown handler fromToolbar.Inputthat trapped Tab and blocked vertical roving focus when disabled;useFocusableWhenDisabledalready prevents text entry without stopping propagation.Toolbar.Root'sdisabledIndicesfrom each item's actual disabled state, fixed the truthy index-0 check, and carried the disabled state in item metadata forToolbar.Button,Toolbar.Input,Toolbar.Link, and directToggleGroup > Togglechildren, so runtimedisabledchanges stay in sync.disabledIndicesresolves a render after the initial map population, so the toolbar stays keyboard-reachable.Toolbar.Groupdisabled into a directToggleGroupchild so its toggles disable along with the group.Toolbar.Separatordata-attribute description and the misleading inheritedorientationdefault; the separator is perpendicular to the toolbar, not always horizontal.Original findings addressed
Toolbar.Inputtrapped focus and blocked vertical roving.Toolbar.RootmiscomputeddisabledIndices(index-0 missed, enabled non-focusable items skipped, rawTogglechildren treated as disabled).tabIndex=0entry.Toolbar.Groupdisabled did not disable a directToggleGroupchild.Toolbar.SeparatorAPI docs showed the misleading inherited defaulthorizontaland describeddata-orientationas the toolbar's orientation.