-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopa: 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.found in release: 2.11Found to occur in 2.11Found to occur in 2.11frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team
Description
Support for text undo/redo was added in #96968, but the coalescing isn't exactly correct on each platform. In that PR, we used a simple time-based throttle on all platforms (code), but the actual behavior is much more nuanced and slightly different on each platform (some analysis). Ideally, Flutter should perfectly match the behavior of each platform.
By coalescing, I mean where the editor separates one undoable chunk of text from the next.
To reproduce
- Run any app with a text input, such as the one given below.
- Type one or two lines of text. Enough that it takes you a few seconds to finish.
- Press ctrl/cmd + Z to undo a few times and notice how the text is grouped.
Expected behavior: The amount of text that is undone at each step exactly matches the native platform.
Actual behavior: It's likely to be off on all platforms.
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(),
),
),
);
}
}TODO
- Figure out what the exact algorithms are for coalescing text input on Windows, Mac, and Linux.
If your app is negatively affected by this, please give a 👍 and maybe leave a comment to help us gauge how this is affecting people.
saibotma
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopa: 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.found in release: 2.11Found to occur in 2.11Found to occur in 2.11frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team