-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[DRAFT] Fix DropdownButtonFormField icon alignment when label text is provided
#159328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] Fix DropdownButtonFormField icon alignment when label text is provided
#159328
Conversation
DropdownButtonFormField icon alignment, color, and size issuesDropdownButtonFormField icon alignment, color, and size issues
|
Blocked by #159431 |
DropdownButtonFormField icon alignment, color, and size issuesDropdownButtonFormField icon alignment when label text is provided
8d9f400 to
450bf25
Compare
450bf25 to
3a99aaf
Compare
bleroux
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! with minor nits.
|
There are Google failures, but they seem to be all intended movement of the icon position. I will try to look through all of them tomorrow. |
justinmc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most Google test failures are intended movement of the dropdown icon, but there are a handful that caused a layout overflow error. A bunch of others had the content of the field truncated by a few extra characters. It does seem like there is effectively less horizontal space available for the text in the field now after the change, which is weird, because the icon seems to have moved horizontally towards the edge of the field, which visually looks like it should give more space!
Any idea why that might have happened? Is it the suffixIconConstraints thing?
Also to confirm, in most cases the icon should have moved both up vertically and towards the edge horizontally, right?
| testWidgets('Form is entirely visible and rejects invalid responses', (WidgetTester tester) async { | ||
| await tester.pumpWidget(const example.AutocompleteExampleApp()); | ||
| expect(find.text('RawAutocomplete Form'), findsOneWidget); | ||
| // One of the icon is hidden for an input decoration height workaround |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"icon" => "icons"
| child: widget.icon ?? defaultIcon, | ||
| // TODO(TahaTessser): Remove InputDecorator height workaround | ||
| // for https://github.com/flutter/flutter/issues/159431. | ||
| // Hiding the icon with maintainSize does not effect the baseline. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"effect" => "affect"
The could be the hidden row icon with maintain size which we've as a workaround. If we remove It conditionally when the dropdownbutton is a form field, we run into a blocker #159431. From your description of the internal failures it looks like this is not good enough to avoid other issues. Thanks for taking look @justinmc |
DropdownButtonFormField icon alignment when label text is providedDropdownButtonFormField icon alignment when label text is provided
Fix DropdownButtonFormField arrow icon is misaligned vertically
Code sample
expand to view the code sample
Before
After
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.