fix(web): keep font picker keyboard selection in sync - #9814
Open
asfires wants to merge 1 commit into
Open
Conversation
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This single-file change fixes keyboard highlight and Enter-selection synchronization in the existing font picker by keeping combobox indexing aligned with virtualized filtered rows. Its runtime impact is confined to this settings interaction, with no schema, persistence, deployment, security, billing, or authentication changes. You can add or adjust custom eligibility rules. Learn more. |
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.
Filtering the font picker can leave visible rows with their old indices, so the first match is not highlighted and Enter does not select it. Keep the full collection separate from the filtered list and refresh virtualized rows when filtering changes their indices.
This is limited to keyboard selection in the existing font picker. The open #7494 addresses monospace detection performance in the same component; this change addresses a separate interaction bug.
Validation: web typecheck and formatting pass; targeted lint reports only two existing effect warnings. In Chromium with installed fonts, typing “Jet” on upstream leaves both results unhighlighted and Enter leaves the picker open. With this fix, the first result highlights, arrow keys move the highlight, and Enter applies JetBrains Mono and closes the picker. No separate Electron run.
Before video
font-before.webm
After video
font-after.webm
Model: GPT-6. Harness: Codex in T3 Code.
Note
Low Risk
Settings UI interaction fix only; no auth, data, or persistence changes.
Overview
Fixes keyboard highlight and Enter selection in the font family picker when the user types a search query.
The combobox now receives the full font list as
itemsand a search-filtered list asfilteredItems, instead of using one list for both. The virtualizedLegendListrendersfilteredItemsand passesextraData={filteredItems}so row memoization refreshes when filtering changes item indices—keeping Base UI’s index-based highlight/selection aligned with what’s on screen.Reviewed by Cursor Bugbot for commit baa063e. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix keyboard selection sync in
FontFamilyPickerComboboxThe
FontFamilyPickerCombobox now receives the full stable collection (default value plus all families) while the virtualized list renders only query-filtered items. Filtered items are passed asLegendListextraDataso memoized rows refresh when filtering changes their indexes, and list height uses the filtered item count.Macroscope summarized baa063e.