fix RichTextField text delete

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-06-17 18:03:32 +08:00
parent 3510b6c74d
commit fe2ebebfdd
2 changed files with 11 additions and 2 deletions

View File

@@ -3568,10 +3568,12 @@ class EditableTextState extends State<EditableText>
remoteValue = delta.apply(remoteValue);
}
final plainText = widget.controller.plainText;
final composing = textEditingDeltas.last.composing;
final newValue = TextEditingValue(
text: widget.controller.plainText,
text: plainText,
selection: widget.controller.newSelection,
composing: textEditingDeltas.last.composing,
composing: composing.end <= plainText.length ? composing : .empty,
);
updateEditingValue(newValue, remoteValue: remoteValue);