Skip to content

Conversation

@yiiim
Copy link
Member

@yiiim yiiim commented Jun 20, 2024

Fixes: #24843
Fixes: #50567

Pre-launch Checklist

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

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. f: routes Navigator, Router, and related APIs. labels Jun 20, 2024
@Piinks Piinks requested a review from justinmc June 20, 2024 20:06
Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I'm still trying to decide if this is the best approach here.

I wonder @chunhtai have you encountered this sort of thing before? Is there any other workaround?


/// When the route state is updated, request focus if the current route is at the top.
///
/// Defaults to true.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you mention Navigator.requestFocus here and explain how they relate?

Copy link
Member Author

Choose a reason for hiding this comment

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

I made it default to Navigator.requestFocus, so it avoids needing two values to control whether to request focus.

required this.clipBehavior,
super.settings,
this.popUpAnimationStyle,
this.requestFocus = false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure that this is the behavior that most people want by default?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, am I right that this parameter will never be passed in since it's private, and it will always be false?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've made changes here, now it defaults to the same behavior as before.

@yiiim yiiim requested a review from justinmc June 27, 2024 15:25
Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

Alright I briefly talked this over with @chunhtai and he doesn't see any reason not to take this approach. I'm on board as well; it makes sense that we should have a per-Route way to do what we already can do with Navigator.requestFocus.

Most of my comments are nits, except for one idea I had for putting this parameter on Route. I think it will clean up the code but I'd like your thoughts!

@yiiim yiiim force-pushed the popupmenu_focus branch from 0e5b6ce to 3342fe1 Compare July 14, 2024 15:30
@github-actions github-actions bot added the f: cupertino flutter/packages/flutter/cupertino repository label Jul 14, 2024
@yiiim yiiim requested a review from justinmc July 14, 2024 15:39
@saif-ellafi
Copy link

Looking forward to this. Thank you

@yiiim yiiim force-pushed the popupmenu_focus branch from 05f8cc6 to 738e5c6 Compare August 4, 2024 02:54
Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

LGTM with a small formatting nit 👍

Copy link
Contributor

@chunhtai chunhtai left a comment

Choose a reason for hiding this comment

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

LGTM

Clip clipBehavior = Clip.none,
RouteSettings? routeSettings,
AnimationStyle? popUpAnimationStyle,
bool? requestFocus,
Copy link
Contributor

Choose a reason for hiding this comment

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

some where in the showMenu doc should mention the behavior of this parameter

@yiiim yiiim added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 8, 2024
@auto-submit auto-submit bot merged commit 14cd5fa into flutter:master Aug 8, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 8, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 8, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 8, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 8, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 9, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Aug 9, 2024
Manual roll requested by [email protected]

flutter/flutter@b6cd31e...76107bd

2024-08-08 [email protected] Re-enable dds for flutter drive tests that use DevTools (flutter/flutter#153129)
2024-08-08 [email protected] Roll Flutter Engine from ef820aa74f7a to 05208896830a (5 revisions) (flutter/flutter#153132)
2024-08-08 [email protected] [devicelab] opt all impeller tests to GPU tracing, opt some Android tests into merged thread mode. (flutter/flutter#153121)
2024-08-08 [email protected] Clean up .gitignore files (flutter/flutter#153060)
2024-08-08 [email protected] Roll Flutter Engine from 387f6f3c5fdb to ef820aa74f7a (4 revisions) (flutter/flutter#153124)
2024-08-08 [email protected] Shift Linux_android_emu tests from staging to prod (flutter/flutter#153110)
2024-08-08 [email protected] Move Android tests with macOS host from staging to prod (flutter/flutter#153113)
2024-08-08 [email protected] Remove -sdk for watchOS simulator in tool (flutter/flutter#152992)
2024-08-08 [email protected] Roll Flutter Engine from 3978ddd8d7a7 to 387f6f3c5fdb (3 revisions) (flutter/flutter#153111)
2024-08-08 [email protected] Roll Packages from 5cc0a01 to bb797b9 (5 revisions) (flutter/flutter#153107)
2024-08-08 [email protected] Roll pub packages [manual] (flutter/flutter#153066)
2024-08-08 [email protected] [web] Fix reading of the --local-web-sdk flag and remove the copy of useLocalWebSdk in DebuggingOptions (flutter/flutter#152642)
2024-08-08 [email protected] The `PopupMenuButton` should not steal focus from the TextField when it appears. (flutter/flutter#150568)
2024-08-08 [email protected] Fix `flutter build ipa --export-method` not accepting `enterprise` flag (flutter/flutter#153047)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
@TahaTesser
Copy link
Member

Hello everyone!

I somehow stumbled on this PR and I noticed this PR adds requestFocus parameter to classes/widgets other than related to PopupMenuButton such as bottom sheet, dialog, transition route, overlay route but doesn't test them.

It makes it possible to remove some of the requestFocus parameters from this PR without failing any tests in the framework.

If anyone is interested in writing tests, please let me know. If not, I'd be happy to write those missing tests.

@yiiim
Copy link
Member Author

yiiim commented Aug 13, 2024

@TahaTesser I'm sorry I didn't write enough tests. It would be great if you could write the tests.

@justinmc
Copy link
Contributor

@TahaTesser Good catch, I missed that!

@TahaTesser
Copy link
Member

Filed a PR with the missing tests #154005

Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 11, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 12, 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: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Popup menu floating with keyboard opened How to pin keyboard when Popupmenu appears

5 participants