Repository navigation
[material_ui] Fix InputDecorator intrinsic height when isDense or isC… - #13522
Merged
auto-submit[bot] merged 1 commit intoNov 5, 2026
Conversation
…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
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_RenderDecoration.computeMinIntrinsicHeightcomputed the minimum container height differently from_layout:_layoutisDense || isCollapsed || expandsinputHeightcomputeMinIntrinsicHeight(before)isDense || expands0.0This caused two mismatches between the intrinsic height and the laid out height:
isDense: truewith 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 toinputHeight, but the intrinsic path clamped to0.0, so the intrinsic height was 8px too short. InsideIntrinsicHeight, this produced theA RenderFlex overflowed by 8.0 pixelserror reported in the issue.isCollapsed: truewithoutisDense(includingInputDecoration.collapsed): the intrinsic path still applied thekMinInteractiveDimension(48px) floor, while layout usedinputHeight, so the intrinsic height was too tall.This PR aligns
computeMinIntrinsicHeightwith_layout.isDense+isCollapsed, zero paddingisDense, zero paddingisCollapsedInputDecoration.collapsedFixes flutter/flutter#190536
Pre-Review Checklist
[shared_preferences]///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Footnotes
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