Fix selection handles showing when using a mouse#168751
Fix selection handles showing when using a mouse#168751auto-submit[bot] merged 5 commits intoflutter:masterfrom
Conversation
0746422 to
7f019f6
Compare
justinmc
left a comment
There was a problem hiding this comment.
LGTM 👍. Thanks for fixing my issue so quick!
| _shouldShowSelectionHandles = | ||
| details.kind == null || | ||
| details.kind == PointerDeviceKind.touch || | ||
| details.kind == PointerDeviceKind.stylus; |
There was a problem hiding this comment.
I double checked this on native Android and indeed the selection handles show when using a stylus. Good call.
| /// [onDragSelectionStart], is called. This getter will return true if the | ||
| /// current [onTapDown], [onSecondaryTapDown], or [onDragSelectionStart] event | ||
| /// is triggered by a touch or a stylus. | ||
| bool get shouldShowSelectionHandles => _shouldShowSelectionHandles; |
There was a problem hiding this comment.
I agree it's worth it to expose this 👍 .
| testWidgets( | ||
| 'Selection handles should not show when using a mouse on Apple platforms using Flutter context menu', |
There was a problem hiding this comment.
Is this test separate from the previous test because iOS uses the system context menu?
There was a problem hiding this comment.
No its mostly separate because of cupertino vs material toolbar. I don't think we can test this specific scenario using the system rendered context menu on iOS since from my understanding they wouldn't show up in a widget test because SystemContextMenu only builds a SizedBox.shrink(). I did try to verify it myself on device and found the behavior is a bit buggy, I opened an issue here with more details and a possible solution (using custom buttons) #168857 .
| await tester.tapAt(firstBlah, kind: PointerDeviceKind.mouse, buttons: kSecondaryMouseButton); | ||
| await tester.pumpAndSettle(); | ||
|
|
||
| switch (defaultTargetPlatform) { |
There was a problem hiding this comment.
Do you need this switch if variant says it's always iOS?
933409c to
93a7d39
Compare
93a7d39 to
cdfb4b2
Compare
Fixes #168252
Pre-launch Checklist
///).