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