Repository navigation
[all components] Skip CSS-hidden composite items in keyboard navigation - #4195
Conversation
commit: |
Bundle size report
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. |
Codex ReviewOverviewThis branch makes CSS-hidden items non-focusable in both arrow-key navigation and Menu typeahead, including the text-navigation path. It also simplifies the typeahead match loop to avoid per-key index-array allocations and centralizes visibility checks. FindingsNo blocking issues found in this patch. 1. ℹ️ [Informational] Grid navigation still dominates keyboard cost at 5,000 itemsImpact: The main runtime cost is still grid-event preparation work, not menu open/list navigation. The hidden-item check adds work in that path because disabled checks are executed many times per key event. Evidence:
Recommendation: Keep this patch for correctness, and treat grid-event optimization as follow-up work if more headroom is needed (cache/reuse per-grid derived data where possible). 2. ℹ️ [Informational] Typeahead loop change improves hit-path cost but worsens miss-path cost on Chromium/FirefoxImpact: The new wrapped loop in Evidence: Typeahead now scans in-place with a wrapped index loop and visibility filtering (
Recommendation: Keep the current implementation for correctness and allocation reduction, and monitor miss-path behavior on Chromium/Firefox in realistic interaction traces if this becomes user-visible. Confidence: 4/5High confidence based on full-branch review, targeted regression tests, and fresh Notes
|
70cf9ce to
23f1da1
Compare
5a50473 to
a5b08f7
Compare
Note on perf: this check only happens in events (measured <0.1ms increase per event on a slow device) or on open for focus sync where the cost is O(k) depending on how many items are disabled (the items need to be scanned to find the first enabled/non-hidden item) but
kis very low in practice. So overhead is ~nonexistent.Fixes #4193