Skip to content

fix(remix): scroll a long RemixSelect list - #341

Open
leoafarias wants to merge 2 commits into
mainfrom
fix/remix-select-scroll
Open

leoafarias wants to merge 2 commits into
mainfrom
fix/remix-select-scroll

Conversation

@leoafarias

Copy link
Copy Markdown
Collaborator

Description

A RemixSelect list taller than its overlay, or taller than a maxHeight on the content or menu container, overflowed the option column (A RenderFlex overflowed by N pixels) instead of scrolling. The Vanilla preset sets a 320 px maxHeight and documents that the panel scrolls, but it did not.

The options now scroll inside a SingleChildScrollView nested within both the content container and the menuContainer box.

  • Padding, decoration, margin, and constraints from either container stay in place while the options scroll, and a maxHeight on either one is honored.
  • A list that fits still shrinks to its options, so short lists are unchanged.
  • Arrow-key navigation scrolls the focused option into view through Flutter's focus traversal.

The scroll view behaves like Flutter's own menus and does not leak into the host page:

  • It sets primary: false, so the overlay does not attach to the page's primary scroll controller.
  • Scroll and scroll-metrics notifications stop at the options. Without this, a Material 3 AppBar elevated while the list scrolled and stayed elevated after the select closed.
  • There is no overscroll stretch or glow and no bounce on iOS or macOS; the list clamps at both ends. The desktop scrollbar stays.

The options column now sizes to its content inside the scroll view, so mainAxisAlignment and mainAxisSize.max on menuContainer no longer distribute free vertical space. The changelog notes this.

No public API changes. docs/components/select.mdx gains a short "Long lists" section.

Validation

  • New Long lists group in select_widget_test.dart (14 tests). It covers:

    • scrolling past the overlay and past a maxHeight;
    • container chrome staying put, and the menu container framing the scroll view;
    • arrow-key navigation;
    • the host primary scroll controller;
    • no notifications reaching the host page or its AppBar;
    • no stretch or bounce, and the desktop scrollbar.

    Each test fails when its piece of the fix is reverted.

  • packages/remix full suite: 2847 passed. registry_source suite: 1390 passed.

  • dart analyze packages/remix, root dart format, melos run ci:checks, and melos run docs:check all pass.

  • The existing applies custom style test asserted on ColumnBox.styleSpec. It now asserts the observable layout: the padding wraps the scrollable.

  • Merged onto the integration branch (chore: integration check for the follow-up stack (do not merge) #339), the select tests and the Vanilla, Fortal, and HeroUI select tests pass.

Known follow-ups, intentionally not in this PR:

  • RemixMenu has the same no-scroll overflow (menu_widget.dart).
  • Home and End in an overlay focus the first or last item without scrolling it into view (naked_ui AnchoredOverlay._focusBoundary). A separate naked_ui PR fixes it.

Merge note

After #331 lands, the focus-ring note in docs/components/select.mdx must also say that the scroll viewport clips an outside row ring once the list scrolls. Today the note says an outside ring is cropped only when the panel sets clipBehavior.

Related Issues

None.


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.

mainAxisAlignment and mainAxisSize.max on menuContainer no longer distribute free vertical space, because the options column now sizes to its content inside the scroll view. No shipped preset relies on it.

A RemixSelect list taller than its overlay, or than a maxHeight on the
content or menu container, overflowed the option column instead of
scrolling. The options now scroll inside a scroll view nested within both
containers, so their padding, decoration, and constraints stay in place.
A list that fits still shrinks to its options.
Scroll notifications from the option list bubbled to the host page, so a
Material 3 AppBar elevated while the list scrolled and stayed elevated after
the select closed. The notifications now stop at the options, including the
scroll metrics notifications that hosts also treat as scrolling.

The list also follows Flutter's own menus: no overscroll stretch, no bounce on
iOS and macOS, clamping at both ends, and the desktop scrollbar stays.

Document the scrolling and the maxHeight that caps it, and note in the
changelog that menuContainer's main-axis alignment and maximal main-axis size
no longer distribute free vertical space.
@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-27T13:56:56.513898Z 907fdeb PR opened
ℹ️ 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