Skip to content

[material_ui] Fix InputDecorator intrinsic height when isDense or isC… - #13522

Merged
auto-submit[bot] merged 1 commit into
flutter:mainfrom
mmohankrishna-lab:fix-input-decorator-intrinsic-height-190536
Nov 5, 2026
Merged

auto-submit[bot] merged 1 commit into
flutter:mainfrom
mmohankrishna-lab:fix-input-decorator-intrinsic-height-190536

Conversation

@mmohankrishna-lab

@mmohankrishna-lab mmohankrishna-lab commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

_RenderDecoration.computeMinIntrinsicHeight computed the minimum container height differently from _layout:

Condition Floor
_layout isDense || isCollapsed || expands inputHeight
computeMinIntrinsicHeight (before) isDense || expands 0.0

This caused two mismatches between the intrinsic height and the laid out height:

  1. isDense: true with compact visual density (the default on desktop and web): the density offset (-8) shrinks the content height below the input height. Layout clamps it back up to inputHeight, but the intrinsic path clamped to 0.0, so the intrinsic height was 8px too short. Inside IntrinsicHeight, this produced the A RenderFlex overflowed by 8.0 pixels error reported in the issue.
  2. isCollapsed: true without isDense (including InputDecoration.collapsed): the intrinsic path still applied the kMinInteractiveDimension (48px) floor, while layout used inputHeight, so the intrinsic height was too tall.

This PR aligns computeMinIntrinsicHeight with _layout.

Density Decoration Laid out height Intrinsic before Intrinsic after
compact isDense + isCollapsed, zero padding 24 16 24
compact isDense, zero padding 24 16 24
standard / compact isCollapsed 24 48 24
standard / compact InputDecoration.collapsed 24 48 24

Fixes flutter/flutter#190536

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2

…ollapsed is true

Aligns the minimum container height in computeMinIntrinsicHeight with the one used during layout, so the intrinsic height matches the laid out height for dense and collapsed decorations, including with compact visual density.

Fixes flutter/flutter#190536
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Nov 2, 2026
@github-actions github-actions Bot added p: material_ui triage-design Should be looked at in design triage labels Nov 2, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the minimum intrinsic height calculation in InputDecorator to match its laid out height when isDense or isCollapsed is true, and adds corresponding regression tests. The review feedback recommends replacing the null-assertion operator on decoration.isDense! with decoration.isDense == true to avoid potential runtime exceptions.

@Piinks Piinks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, thank you!

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 5, 2026
@auto-submit
auto-submit Bot merged commit f631bb8 into flutter:main Nov 5, 2026
12 checks passed
flutter-zl pushed a commit to NemesisDevX/flutter that referenced this pull request Nov 6, 2026
flutter/packages@0478162...63881f9

2026-11-06 [email protected] [material_ui] Paint Dialog.fullscreen
background color behind the keyboard (flutter/packages#13244)
2026-11-05 [email protected] [material_ui] Add tabBar/tab
roles and expanded state semantics (flutter/packages#13176)
2026-11-05 [email protected]
[material_ui] Disable the DropdownButtonFormField decoration when the
field is disabled (flutter/packages#13473)
2026-11-05 [email protected] [material_ui] Fix Switch throwing when first
painted mid-animation (flutter/packages#13496)
2026-11-05 [email protected] [various] Add
engineIdentifier to fake plugin registrars (flutter/packages#13574)
2026-11-05 [email protected] [google_sign_in]
Allow GoogleSignIn-iOS 10 (flutter/packages#13306)
2026-11-05 [email protected] [material_ui] Hit
test the floating label of InputDecorator at its painted position
(flutter/packages#13326)
2026-11-05 [email protected] [material_ui] Fix InputDecorator
intrinsic height when isDense or isC… (flutter/packages#13522)
2026-11-05 [email protected] [material_ui] Paint Scaffold
persistent bottom sheet background color behind the keyboard
(flutter/packages#13242)
2026-11-05 [email protected] [image_picker_ios] PR 5/5 Switch
Pigeon to Swift and finish the Objective-C to Swift migration.
(flutter/packages#13493)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: material_ui triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InputDecorator with IntrinsicHeight does not conform layout height when isDense: true or isCollapsed: true

2 participants