Skip to content

Fix ComboBox height clipping under text scaling - #1348

Merged
bdlukaa merged 7 commits into
masterfrom
copilot/fix-combobox-text-scaler-issue
Aug 3, 2026
Merged

Fix ComboBox height clipping under text scaling#1348
bdlukaa merged 7 commits into
masterfrom
copilot/fix-combobox-text-scaler-issue

Conversation

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

ComboBox used a fixed item height, so larger system text scaling could clip the selected value in the closed control. This updates ComboBox sizing to behave like other input controls by allowing vertical growth with scaled text.

  • Root cause

    • ComboBox button content was constrained by a fixed height in _ComboBoxItemContainer, which did not adapt when text metrics increased.
  • Implementation

    • Replaced fixed height with a minimum-height constraint in _ComboBoxItemContainer.
    • Preserves baseline compact sizing while allowing the control to expand when scaled text requires more vertical space.
  • Regression coverage

    • Added a widget test that compares ComboBox height at TextScaler.linear(1) vs TextScaler.linear(2) and asserts the scaled case is taller.
  • Changelog

    • Added a [next] changelog entry documenting ComboBox text-scaling height behavior.
return Container(
  constraints: BoxConstraints(
    minHeight: hasPadding
        ? adjustedItemHeight
        : (adjustedItemHeight - _kMenuItemBottomPadding).clamp(
            0.0,
            double.infinity,
          ),
  ),
  alignment: AlignmentDirectional.centerStart,
  child: ...
);

Copilot AI changed the title [WIP] Fix ComboBox not considering textScaler for height Fix ComboBox height clipping under text scaling Aug 2, 2026
Copilot AI requested a review from bdlukaa August 2, 2026 22:42
@bdlukaa
bdlukaa marked this pull request as ready for review August 2, 2026 23:01
@bdlukaa

bdlukaa commented Aug 2, 2026

Copy link
Copy Markdown
Owner

@copilot Use MediaQuery.textScalerOf(context).scale instead of dynamic height because the each tile inside the combo box overlay should have the same height as the button.

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Use MediaQuery.textScalerOf(context).scale instead of dynamic height because the each tile inside the combo box overlay should have the same height as the button.

Updated in 4975aac. _ComboBoxItemContainer now uses MediaQuery.textScalerOf(context).scale(...) for both menu-item and button heights, replacing the intrinsic/dynamic height approach.

@bdlukaa
bdlukaa merged commit 8c419f1 into master Aug 3, 2026
3 checks passed
@bdlukaa
bdlukaa deleted the copilot/fix-combobox-text-scaler-issue branch August 3, 2026 11:17
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 doesn't take textScaler in account

2 participants