-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Hide the context menu on tap down #126295
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
@@ -2108,10 +2108,13 @@ class TextSelectionGestureDetectorBuilder { | |||
switch (defaultTargetPlatform) { | |||
case TargetPlatform.android: | |||
case TargetPlatform.fuchsia: | |||
// On mobile platforms the selection is set on tap up. | |||
editableText.hideToolbar(false); |
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.
I tried this on Android with a physical mouse and the handle remains visible:
20230508_154010.mp4
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.
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
The golden failure was not desired, I've pushed a commit to fix it. |
Golden file changes are available for triage from new commit, Click here to view. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
Actually I think the best move is to update the golden. I tested on native Android 13 in the Keep app, and the handle remains visible after tapping outside of an existing selection (see the existing test). That's how Flutter behaves with this PR now. |
Desktop text selection toolbar no longer flashes before closing.
Previously, tapping to move the cursor while the context menu was open would update the contents of the text selection toolbar before closing it, so a briefly flash of change was seen. This PR fixes it by correctly hiding the menu on tap down instead of up.
Fixes #125364