Unverified Commit 30846de3 authored by Justin McCandless's avatar Justin McCandless Committed by GitHub

Material text selection menu should not show pointer cursor (#100248)

parent ff74557c
......@@ -332,6 +332,8 @@ class _DesktopTextSelectionToolbarButton extends StatelessWidget {
child: TextButton(
style: TextButton.styleFrom(
alignment: Alignment.centerLeft,
enabledMouseCursor: SystemMouseCursors.basic,
disabledMouseCursor: SystemMouseCursors.basic,
primary: primary,
shape: const RoundedRectangleBorder(),
minimumSize: const Size(kMinInteractiveDimension, 36.0),
......
......@@ -10027,6 +10027,45 @@ void main() {
await gesture.moveTo(center);
});
testWidgets('Text selection menu does not change mouse cursor when hovered', (WidgetTester tester) async {
final TextEditingController controller = TextEditingController(
text: 'Atwater Peel Sherbrooke Bonaventure',
);
await tester.pumpWidget(
MaterialApp(
home: Material(
child: MouseRegion(
cursor: SystemMouseCursors.forbidden,
child: TextField(
controller: controller,
),
),
),
),
);
expect(find.text('Copy'), findsNothing);
final TestGesture gesture = await tester.startGesture(
textOffsetToPosition(tester, 3),
kind: PointerDeviceKind.mouse,
buttons: kSecondaryMouseButton,
);
addTearDown(gesture.removePointer);
await tester.pump();
await gesture.up();
await tester.pumpAndSettle();
expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.text);
expect(find.text('Copy'), findsOneWidget);
await gesture.moveTo(tester.getCenter(find.text('Copy')));
expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic);
},
variant: TargetPlatformVariant.desktop(),
skip: isContextMenuProvidedByPlatform, // [intended] only applies to platforms where we supply the context menu.
);
testWidgets('Caret rtl with changing width', (WidgetTester tester) async {
late StateSetter setState;
bool isWide = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment