-
Notifications
You must be signed in to change notification settings - Fork 28.6k
Fix menu width issue for DropdownMenu
#123823
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
Conversation
525f09d
to
bcf61ce
Compare
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
@@ -826,6 +826,7 @@ class _DropdownMenuDefaultsM3 extends DropdownMenuThemeData { | |||
return const MenuStyle( | |||
minimumSize: MaterialStatePropertyAll<Size>(Size(_kMinimumWidth, 0.0)), | |||
maximumSize: MaterialStatePropertyAll<Size>(Size.infinite), | |||
visualDensity: VisualDensity.standard, |
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.
@QuncCccccc this seems partially a bit unrelated to the issue. It will make the menu unresponsive the general theme VisualDensity
changes. Unless the used TextField
in the DropdownMenu
already is that as well already. Then it makes sense to make sure sizes always line up. Are all the other menus also locked and not changing with VisualDensity
? If so (I will check) it makes even more sense. If we can avoid inconsistencies that is always nice. I have heard feedback from Flutter devs that were raging about inconsistencies in VisualDenisity
behavior in general in Flutter, but that is another topic.
Nice find with the key
, would have taken me a while to figure that out. Thanks for the quick fix.
Fixes: #123631.
This PR is to fix the menu width. It should be the same width as the input field.
Borrow the same example that shows in the issue description:)

Pre-launch Checklist
///
).