-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Hide the text selection toolbar on mobile when orientation changes #103512
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
Hide the text selection toolbar on mobile when orientation changes #103512
Conversation
0996959 to
e5c0cfe
Compare
|
This behavior is also present on Android. Tested on Pixel 6 Pro running Android 12 May Security Update in native Messages App, Google Keep, and Gmail. Other than that LGTM. |
|
@Renzo-Olivares Okay I wasn't able to confirm this in all native apps but when creating a native Android project it is present so I think you are right. Also on Android, it seems the handles are hidden as well, not just the toolbar. |
e5c0cfe to
85e8d50
Compare
|
@markusaksli-nc Yeah the selection handles are also hidden, forgot to mention that. |
64429a9 to
8c4f0c9
Compare
Renzo-Olivares
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
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.
LGTM 👍. Just some nits below. Thanks for fixing this old issue!
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.
Nit: There's no need to do any of the below if the platform isn't android or iOS. You could return early here on those other platforms, but I'm not sure how much benefit you would get from that in reality. Up to you @markusaksli-nc if you want to do it.
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 thought this would make the purpose and value of _lastOrientation a bit niche and opaque but now that I think about it, it wouldn't reflect physical rotation on other platforms anyway.
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.
Nit: Maybe a switch on the platform here if you think that would be better?
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 considered it but this is more compact and I think it's just as readable.
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.
Indent here.
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.
Nit: 1800.0 and 2400.0
8c4f0c9 to
4dfa1bc
Compare
|
I thought of a weird niche scenario where this logic might fail: On my Galaxy Tab S8 Ultra I can attach a physical keyboard + touchpad and switch to Samsung's pseudo-desktop environment Samsung Dex. There you can resize app windows (making the constraints go from portrait to landscape). When compared to a basic Android native application, however, there is no difference in behavior so this PR is fine. That being said @justinmc I didn't see this in your context menus design doc and I just found this out myself: did you know that right-clicking with a physical touchpad on Android in said basic Android native app gives this expanded huge context menu by default (at least on my Tab S8 Ultra)? This is obviously completely different from flutter, where it just shows the regular text selection toolbar. Didn't find an issue for this either. Also cheers for the quick reviews (and @justinmc I really enjoyed your I/O workshop on macOS flutter development) |
|
This pull request is not suitable for automatic merging in its current state.
|
|
@justinmc need some help with failed google testing |
|
(from triage): The failures looked unrelated. I've kicked off another test run to verify... |
|
@goderbauer did it fail again? |
|
Could you rebase this with the latest master to try again? |
4dfa1bc to
9e51360
Compare

Hide the text selection toolbar on Android and iOS when orientation changes by keeping track of the previous orientation in
didChangeDependencies. Hide text selection handles as well on Android to match native project behavior.Fixes #72004
Pre-launch Checklist
///).