Skip to content

Commit

Permalink
Merge pull request #1 from nvshah/fix/1388-initialval_retained-main
Browse files Browse the repository at this point in the history
fix: logic - respect latest field initial value instead of assigning …
  • Loading branch information
nvshah authored May 4, 2024
2 parents 626bd43 + 82bd4ef commit bd14ab4
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 bd14ab4

Please sign in to comment.