diff --git a/lib/src/text_field/base_text_field.dart b/lib/src/text_field/base_text_field.dart index 9a96342..22b2429 100644 --- a/lib/src/text_field/base_text_field.dart +++ b/lib/src/text_field/base_text_field.dart @@ -256,7 +256,13 @@ class BaseTextFieldState extends State // We don't need anything whenever the change is from the textfield itself if (_textEditingController.text == text) return; - // this will be called, whenever a change comes from outside and we need to handle the changed event + // The change comes from outside. We update [_previousTextValue] before + // mutating the controller so the controller listener ([_onChanged]) + // does not re-emit [onChanged] for a value we already + // know about (which would write the external value straight back). + _previousTextValue = text; + + // this will be called, whenever a change comes from outside and we need to handle the changed event. onNextFrame(() { if (text.isEmpty) { _textEditingController.clear();