update RichTextField

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-06-11 10:49:31 +08:00
parent 7a1cb222d6
commit d2de063ccc
4 changed files with 40 additions and 59 deletions

View File

@@ -3280,13 +3280,7 @@ class EditableTextState extends State<EditableText>
}
if (kIsWeb && _hasInputConnection) {
final obscureTextChanged = oldWidget.obscureText != widget.obscureText;
if (obscureTextChanged || oldWidget.keyboardType != widget.keyboardType) {
if (obscureTextChanged) {
// When obscureText is toggled, we should reset its state to prevent the last character from being visible between state changes.
_obscureShowCharTicksPending = 0;
_obscureLatestCharIndex = null;
}
if (oldWidget.readOnly != widget.readOnly) {
_textInputConnection!.updateConfig(
_effectiveAutofillClient.textInputConfiguration,
);
@@ -3294,8 +3288,13 @@ class EditableTextState extends State<EditableText>
}
if (_hasInputConnection) {
if (oldWidget.obscureText != widget.obscureText ||
oldWidget.keyboardType != widget.keyboardType) {
final obscureTextChanged = oldWidget.obscureText != widget.obscureText;
if (obscureTextChanged || oldWidget.keyboardType != widget.keyboardType) {
if (obscureTextChanged) {
// When obscureText is toggled, we should reset its state to prevent the last character from being visible between state changes.
_obscureShowCharTicksPending = 0;
_obscureLatestCharIndex = null;
}
_textInputConnection!.updateConfig(
_effectiveAutofillClient.textInputConfiguration,
);