Repository navigation
fix(naked_ui): scroll the highlighted combobox option into view - #350
Open
leoafarias wants to merge 3 commits into
Open
leoafarias wants to merge 3 commits into
leoafarias wants to merge 3 commits into
Conversation
NakedCombobox keeps its highlight in RawAutocomplete and never moves focus, so nothing scrolled a highlighted option that sat outside a scrolling options list: five ArrowDowns highlighted an option below a 120px list. An option now reveals itself after the frame in which it becomes highlighted, including when the list is reopened with the highlight still set. The reveal is the one requestFocusInView uses, now shared through revealInView: end then start, so the option scrolls just far enough from either side and in either reading direction, and an option that is already visible leaves the list and the page alone.
Revealing from each option's initState made a lazily built list jump when the user scrolled back toward the highlight: the option is disposed while far away and rebuilt on the way back, and the rebuilt option revealed itself again. NakedCombobox now remembers the highlighted index it last revealed and the option reveals itself only when that index changes. The memory resets when the options view unmounts, so reopening still reveals the highlight. The reveal is the revealInView from the #344 update, which stops at scrollables that do not render the option. Document that opening replaces a caller-set scroll offset when the highlight is outside it, and that an unbuilt highlighted option in a lazy list is not revealed.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
leoafarias
added a commit
that referenced
this pull request
Oct 27, 2026
This was referenced Oct 27, 2026
This branch has not been deployed
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.
Description
NakedComboboxkeeps its highlight inRawAutocompleteand never moves focus, so nothing scrolled a highlighted option that sat outside a scrolling options list. Five Arrow Downs highlighted an option below a 120px list.An option now reveals itself, just far enough, in the frame after its index becomes the highlight, and when the options view opens with the highlight outside the viewport. Focus stays on the field.
revealInView. An option that is already visible leaves the list and the page alone, and scrollables that do not render the option are not scrolled. That covers a host page, or aPageViewaround a nestedNavigator.NakedComboboxremembers the highlight index it last revealed and resets it when the options view unmounts. It reveals only when the index changes, so scrolling a lazily built list by hand toward the highlight is not pulled back, whether by wheel, drag, or jump, and whether or not the options are keyed.Documented limitations:
Validation
New tests on a 30-option, 120px list:
ListView.builderkeeps the user's position after a wheel scroll, drag, or jump back.Navigatorin aPageViewkeeps the route and page offsets.Each fails when the fix, the claim, the unmount reset, or fix(naked_ui): scroll keyboard focus targets into view in overlays, tabs, toggle groups, and menubars #344's boundary rule is removed.
packages/naked_ui: full suite 995 passed.dart analyze: one existing info. Root format andmelos run ci:checks: clean.Related Issues
Stacked on #344; merge after it. Belongs in naked_ui 1.3.0.
Checklist
///).Breaking Change