Skip to content

Commit

Permalink
fix: logic - respect latest field initial value instead of assigning …
Browse files Browse the repository at this point in the history
…it old field value

TASK flutter-form-builder-ecosystem#1388
  • Loading branch information
nvshah committed May 4, 2024
1 parent 626bd43 commit 82bd4ef
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/src/form_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,7 @@ class FormBuilderState extends State<FormBuilder> {

_fields[name] = field;
field.registerTransformer(_transformers);

field.setValue(
oldField?.value ?? (_instantValue[name] ??= field.initialValue),
populateForm: false,
);
_instantValue[name] = field.initialValue;
}

void unregisterField(String name, FormBuilderFieldState field) {
Expand Down

0 comments on commit 82bd4ef

Please sign in to comment.