Skip to content

fix(remix): fit RemixSelect and RemixMenu panels to the space beside their trigger - #348

Open
leoafarias wants to merge 7 commits into
fix/remix-menu-scrollfrom
fix/remix-panels-fit-beside-trigger
Open

leoafarias wants to merge 7 commits into
fix/remix-menu-scrollfrom
fix/remix-panels-fit-beside-trigger

Conversation

@leoafarias

@leoafarias leoafarias commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Description

A long RemixSelect list or RemixMenu now scrolls (#341, #345), but its panel was still laid out as tall as the whole overlay, so it slid over its trigger.

RemixSelect and the root RemixMenu now pass constrainToAvailableHeight: true to NakedSelect and NakedMenu (#347).

  • The panel is capped at the room above or below the trigger, after sideOffset and collisionPadding, and opens on the side with more room.
  • A panel that fits is unchanged.
  • Submenus are unchanged: they open to the right or left and keep the room the overlay has.
  • docs/components/select.mdx "Long lists" and docs/components/menu.mdx "Long menus" describe this. The CHANGELOG has a Fixes entry.

Known limitation, tracked as a follow-up: positioning does not subtract safe-area or keyboard insets, so on mobile a long panel can extend under the keyboard.

Validation

  • 6 new tests. 4 fail without the two constrainToAvailableHeight lines: a long select and a long menu, each near the top and near the bottom of the screen. The two short-panel tests are guards.
  • Select and menu tests (391) and the full remix suite (2878) pass, including fix(remix): scroll a long RemixSelect list #341's and fix(remix): scroll a long RemixMenu #345's scrolling tests.
  • dart analyze, format, melos run ci:checks, and melos run docs:check: clean.

Continuation: a6d6a0dda fixes the shared Vanilla consumer fixture exposed by this change. The old overlay entry stretched the select trigger to the full viewport, leaving no space beside it. A scoped Center inside that entry restores its natural size; the original option callback assertion stays and hit-testability is checked before tapping. Exact failure reproduced, then 4 focused tests pass. No production changes. Fresh CI on this head is green. The strict complete local gate also passes on combined f40536ba9 (final integration plus all three adoption heads), including every fresh-consumer leg, with no generated/tree drift.

Merge note

Stacked on #345, with #347's naked_ui commits merged in, so this diff shows them until #347 lands. Merge after naked_ui 1.3.0 (which includes #347) is released. The naked_ui release PR raises remix's naked_ui floor, and then this PR's diff is the Remix opt-in alone.

Related Issues

Needs #341, #345, and #347.


Checklist

  • My PR includes unit or integration tests for all changed/updated/fixed behaviors.
  • I have updated or added relevant documentation (doc comments with ///).
  • I am prepared to follow up on review comments in a timely manner.

Breaking Change

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

…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.
…their trigger

A long select list or menu is laid out as tall as the whole overlay, so it
slides over its trigger even though it now scrolls. Pass
constrainToAvailableHeight to NakedSelect and to the root NakedMenu so the
panel is capped at the room above or below the trigger and opens on the side
with more room. Submenus keep the room the overlay has.
…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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T00:53:10.255109Z a6d6a0d New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant