Skip to content

Conversation

@neko-andrew
Copy link
Contributor

@neko-andrew neko-andrew commented Nov 8, 2023

Fix min intrinsic width of input decorator by removing left or right padding when prefixIcon or suffixIcon are used.

Fixes #137937.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

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

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie or stuartmorgan on the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Nov 8, 2023
@neko-andrew
Copy link
Contributor Author

neko-andrew commented Nov 8, 2023

I'm unsure how to run a flutter app with my local changes so I can't get a screen shot of the fix. Can someone help me figure out how to do this?

@neko-andrew
Copy link
Contributor Author

I would also like help on how I would write a test for this change.

@LongCatIsLooong
Copy link
Contributor

I would also like help on how I would write a test for this change.

I think you could check the location of the left-most component and the right-most component and see if the horizontal distance they cover is the same as the width getMinIntrinsicWidth reported.

@neko-andrew
Copy link
Contributor Author

I added a test which showed that I also had to fix the max intrinsic width.

@neko-andrew neko-andrew force-pushed the fix-input-decorator-instrinsic-width branch from 8054de2 to 2fe03a1 Compare November 16, 2023 07:43
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: consider making 0 -> 0.0 per style guidelines. Here and in other places in this PR.

Copy link
Contributor

@Renzo-Olivares Renzo-Olivares left a comment

Choose a reason for hiding this comment

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

Hi @neko-andrew, thanks for the contribution. This change LGTM just had a small nit. I also see similar logic to calculate the input width in _layout.

@LongCatIsLooong LongCatIsLooong added autosubmit Merge PR when tree becomes green via auto submit App and removed autosubmit Merge PR when tree becomes green via auto submit App labels Nov 16, 2023
@neko-andrew
Copy link
Contributor Author

Seems like "Google testing" failed. The details don't really provide any information. What does this mean?

@neko-andrew neko-andrew force-pushed the fix-input-decorator-instrinsic-width branch from 2fe03a1 to 33952a3 Compare November 17, 2023 06:07
@neko-andrew neko-andrew force-pushed the fix-input-decorator-instrinsic-width branch from 33952a3 to 79a80e1 Compare November 17, 2023 06:10
@neko-andrew
Copy link
Contributor Author

Can I get help with the failing "Google Testing"?

@LongCatIsLooong
Copy link
Contributor

LongCatIsLooong commented Nov 28, 2023

The internal golden changes LGTM. Sorry for the delay!

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 29, 2023
@neko-andrew
Copy link
Contributor Author

What is the process of getting these changes into a hot fix?

caseycrogers pushed a commit to caseycrogers/flutter that referenced this pull request Dec 29, 2023
Fix min intrinsic width of input decorator by removing left or right padding when `prefixIcon` or `suffixIcon` are used.

Fixes flutter#137937.
neko-andrew added a commit to neko-andrew/flutter that referenced this pull request Jan 15, 2024
Fix min intrinsic width of input decorator by removing left or right padding when `prefixIcon` or `suffixIcon` are used.

Fixes flutter#137937.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 16, 2024
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 f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TextField's intrinsic width isn't properly calculated when PrefixIcon or SuffixIcon are used

3 participants