Why does the cursor shows up at the beginning of the existing text, instead of the position where the user taps, when I re-edit my TextField. This happens when you unfocus the textfield then refocus on it again.
Example code:
class Mypage extends StatelessWidget {
const Mypage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextField(
controller: TextEditingController()..text = 'Existing Text Here',
),
TextButton(
onPressed: () {
FocusScope.of(context).unfocus();
},
child: Text('Unfocus'))
],
),
),
);
}
}