Skip to content

Fix ComboBox popup layout when opened at viewport bottom edge - #1351

Open
bdlukaa with Copilot wants to merge 6 commits into
masterfrom
copilot/fix-combobox-rendering-exception
Open

Fix ComboBox popup layout when opened at viewport bottom edge#1351
bdlukaa with Copilot wants to merge 6 commits into
masterfrom
copilot/fix-combobox-rendering-exception

Conversation

Copilot AI commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

ComboBox could hit a debug layout assertion when the control was fully aligned to the bottom of the viewport, causing the popup to render with an invalid vertical position. This change hardens popup placement so the menu always stays within available bounds.

  • Popup layout clamping

    • Updated _ComboBoxMenuRouteLayout.getPositionForChild to clamp the computed popup top based on the actual childSize.height and viewport height.
    • Replaced the previous assert assumptions (menuLimits.top + menuLimits.height <= size.height) with bounds checks on the clamped position used for rendering.
  • Regression test for bottom-edge placement

    • Added a widget test that places ComboBox at the bottom of a fixed-height viewport, opens it, and asserts no exception is thrown while menu items render correctly.
  • Changelog update

    • Added a 4.16.2 entry documenting the ComboBox bottom-edge assertion fix.
final top = menuLimits.top.clamp(
  0.0,
  math.max(0.0, size.height - childSize.height),
);

assert(top >= 0.0);
assert(top + childSize.height <= size.height);

return Offset(left, top);

Co-authored-by: bdlukaa <45696119+bdlukaa@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix ComboBox rendering exception at bottom of screen Fix ComboBox popup layout when opened at viewport bottom edge Aug 28, 2026
Copilot AI requested a review from bdlukaa August 28, 2026 13:35
@bdlukaa
bdlukaa marked this pull request as ready for review August 29, 2026 18:19
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.

🐛 ComboBox throws rendering exception when it is rendered at the bottom of the screen

2 participants