Repository navigation
feat(naked_ui): fit anchored select and menu panels to the space beside their trigger - #347
Open
leoafarias wants to merge 2 commits into
Open
leoafarias wants to merge 2 commits into
leoafarias wants to merge 2 commits into
Conversation
…e their trigger OverlayPositioner laid its child out with the whole overlay as the maximum height, so a panel taller than the room above or below its trigger slid over the trigger instead of fitting beside it. Add constrainToAvailableHeight to OverlayPositioner, AnchoredOverlay, NakedSelect, and NakedMenu. When set, a panel placed above or below the anchor is capped at the space on that side after sideOffset and collisionPadding. With collision avoidance on, the cap is the larger side, so the existing flip lands on it; without, it is the preferred side. Left and right placements are not capped. The option defaults to false, so panels that cannot scroll keep today's layout.
…n its defaults The option is new public API with a false default, so it belongs under Features. Drop the unexported AnchoredOverlay from the entry and say that the larger side bounds the layout while the panel stays on the preferred side when it fits there. The select and menu tests now leave the argument out to pin the default, and a positioner test turns the option on and off to cover shouldRelayout.
4 of 5 tasks
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
…on stack # Conflicts: # packages/naked_ui/CHANGELOG.md # packages/naked_ui/test/src/naked_menu_test.dart
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
A tall
NakedSelectorNakedMenupanel is laid out as tall as the whole overlay, so it slides over its trigger.This adds an opt-in
constrainToAvailableHeighttoNakedSelect,NakedMenu, andOverlayPositioner. The internalAnchoredOverlayforwards it.sideOffsetandcollisionPadding.false, so panels that cannot scroll keep today's layout. Content that cannot scroll overflows a capped panel.It is opt-in because turning it on everywhere overflowed non-scrolling panels, including this repo's 15-option select tests. It would also have reached
RemixSelectandRemixMenuon beta.13 through a naked_ui upgrade, before they can scroll.Validation
shouldRelayoutclause, or flipping a default totrue, fails the intended tests.dart analyze, format, andmelos run ci:checksare clean.sideOffset, padding, and panel height against the flip-then-cap rule, with 0 failures.Related Issues
Follows the select and menu scroll PRs #341 and #345. Remix opts in through a separate PR stacked on #345. Belongs in naked_ui 1.3.0. Positioning still ignores safe-area and keyboard insets; that is tracked separately.
Checklist
///).Breaking Change
The new parameters default to
false.