-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.platform-macBuilding on or for macOS specificallyBuilding on or for macOS specifically
Description
Currently, shift+tap on an unfocused field continues the selection that was last in that field. This seems to be correct for all platforms except for Mac, which always starts the selection at 0. We should get this behavior correct on Mac too.
CC @dkwingsmt, who noticed this in #95213 (comment).
To reproduce
- Run the app below on Mac (or just use any text field).
- Type something in the input.
- Unfocus the field by clicking elsewhere.
- Hold shift and tap in the middle of the field.
Expected behavior: The selection goes from 0 to the click location.
Actual behavior: The selection goes from the previous cursor location (end of the field) to the click location.
Code
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
appBar: AppBar(
title: const Text('Flutter Demo'),
),
body: const Center(
child: TextField(),
),
),
);
}
}Metadata
Metadata
Assignees
Labels
a: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.platform-macBuilding on or for macOS specificallyBuilding on or for macOS specifically