Skip to content

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

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

QuncCccccc
Copy link
Contributor

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:)
Screenshot 2023-03-30 at 3 26 55 PM

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.

@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Mar 30, 2023
@QuncCccccc QuncCccccc marked this pull request as ready for review March 31, 2023 00:20
@QuncCccccc QuncCccccc requested a review from HansMuller March 31, 2023 00:21
@QuncCccccc QuncCccccc force-pushed the fix_menu_anchor_width branch from 525f09d to bcf61ce Compare March 31, 2023 00:22
Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

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

LGTM

@QuncCccccc QuncCccccc merged commit db5434e into flutter:master Mar 31, 2023
@@ -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,
Copy link
Contributor

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.

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2023
exaby73 pushed a commit to NevercodeHQ/flutter that referenced this pull request Apr 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

[Material3] DropdownMenu's menu overlay size issue
3 participants