opt pub textfield

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-25 14:36:18 +08:00
parent 27023a305d
commit 0b95476d8f

View File

@@ -3277,12 +3277,15 @@ class EditableTextState extends State<EditableText>
_atUserRegex.firstMatch(text.substring(0, offset)); _atUserRegex.firstMatch(text.substring(0, offset));
if (match != null) { if (match != null) {
updateEditingValue(TextEditingDeltaDeletion( userUpdateTextEditingValue(
oldText: e.oldText, TextEditingDeltaDeletion(
deletedRange: TextRange(start: match.start, end: match.end), oldText: e.oldText,
selection: TextSelection.collapsed(offset: match.start), deletedRange: TextRange(start: match.start, end: match.end),
composing: e.composing, selection: TextSelection.collapsed(offset: match.start),
).apply(_value)); composing: e.composing,
).apply(_value),
SelectionChangedCause.keyboard,
);
widget.onDelAtUser?.call(match.group(0)!.trim()); widget.onDelAtUser?.call(match.group(0)!.trim());
return; return;
} }
@@ -3290,9 +3293,11 @@ class EditableTextState extends State<EditableText>
} }
} }
TextEditingValue value = _value;
for (final TextEditingDelta delta in textEditingDeltas) { for (final TextEditingDelta delta in textEditingDeltas) {
updateEditingValue(delta.apply(_value)); value = delta.apply(value);
} }
updateEditingValue(value);
} }
@override @override