Unverified Commit 2668f90d authored by Justin McCandless's avatar Justin McCandless Committed by GitHub

Composing text shouldn't be part of undo/redo (#108765)

Fixes undo/redo behavior when using a composing keyboard, especially on desktop.
parent 780ceb56
......@@ -4712,6 +4712,24 @@ class _TextEditingHistoryState extends State<_TextEditingHistory> {
return;
}
switch (defaultTargetPlatform) {
case TargetPlatform.iOS:
case TargetPlatform.macOS:
case TargetPlatform.fuchsia:
case TargetPlatform.linux:
case TargetPlatform.windows:
// Composing text is not counted in history coalescing.
if (!widget.controller.value.composing.isCollapsed) {
return;
}
break;
case TargetPlatform.android:
// Gboard on Android puts non-CJK words in composing regions. Coalesce
// composing text in order to allow the saving of partial words in that
// case.
break;
}
_throttleTimer = _throttledPush(widget.controller.value);
}
......
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