Repository navigation
Dragging the collapsed cursor doesn't match native #118268
Copy link
Copy link
Closed
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problems
Description
When dragging the collapsed cursor in a text field on Android and iOS, 1. the loupe does not appear and 2. edge scrolling doesn't work. This is referring to dragging the cursor itself, not dragging the collapsed selection handle (which does work on Android and doesn't exist on iOS).
| Scenario | Dragging the collapsed handle | Dragging the cursor |
|---|---|---|
| Flutter on Android | ✅ ![]() |
❌ ![]() |
| Flutter on iOS | n/a | ❌ ![]() |
Steps to reproduce
- Run any app with multiple lines of editable text, such as the one given below.
- Tap to place the cursor.
- Perform a drag gesture on the cursor.
Expected: The cursor follows the drag, the loupe appears, and edge scrolling works.
Actual: The cursor does follow the drag, but the loupe doesn't appear, and scrolling off the edge causes the cursor to stop following the drag instead of scrolling.
Repro code
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final TextEditingController _controller = TextEditingController(
text: 'Lorem ipsum dolor sit amet,\nconsetetur sadipscing elitr,\nsed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,\nsed diam voluptua.\nAt vero eos et accusam et justo duo dolores et ea rebum.\nStet clita kasd gubergren,\nno sea takimata sanctus est Lorem ipsum dolor sit amet.',
);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
TextField(
controller: _controller,
minLines: 4,
maxLines: 4,
),
],
),
),
);
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problems



Activity
[-]Dragging the cursor doesn't match native[/-][+]Dragging the collapsed cursor doesn't match native[/+]justinmc commentedon Jan 10, 2023
CC @Renzo-Olivares, you mentioned that this was probably caused by your tap and drag work.
Renzo-Olivares commentedon Jan 11, 2023
This looks its the expected behavior on native iOS. I tried in the
iMessageinput field and the cursor will not follow the drag unless the drag begins on the cursor itself. If it doesn't the TextField just scrolls up and down.Renzo-Olivares commentedon Jan 11, 2023
On native Android I'm noticing that scrolling up and down, the cursor doesn't exactly move with the drag but it is placed somewhere in the current visible text view.
Show magnifier on touch drag gestures (#125151)
github-actions commentedon May 4, 2023
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.