Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/src/text_field/base_text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,13 @@ class BaseTextFieldState extends State<BaseTextField>
// 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();
Expand Down
Loading