-
-
Notifications
You must be signed in to change notification settings - Fork 540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: #1388 Respect latest field's initial value (esp when its forcefully recreated) #1389
fix: #1388 Respect latest field's initial value (esp when its forcefully recreated) #1389
Conversation
fix: logic - respect latest field initial value instead of assigning …
Hi! Thanks for contribution! I updated the build to run with flutter 3.22. Take a look if can change the solution or have some way to pass tests without delete them |
Hi, I doubt whether this is the actual root cause or not. I was able to temporarily fix this issue where the initial value is not being assigned upon reset by reverting to the version 7 which has the same code that is being replaced in this PR, but not in shorthand form. if (oldField != null) {
// ignore: invalid_use_of_protected_member
field.setValue(oldField.value, populateForm: false);
} else {
// ignore: invalid_use_of_protected_member
field.setValue(
_instantValue[name] ??= field.initialValue,
populateForm: false,
);
} Therefore it leads me to think it's some other change which is causing this issue and not because of this specific piece of code being changed in the PR. I will try to compare changes and update if I get time. |
fix: respecting initial value from formbuilder map when field misses initial value
Updated the PR @deandreamatias |
fix: respect initial value on field re-creation, from formbuilder
fix: field value retaining when clearValueOnUnregister = true
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1389 +/- ##
==========================================
+ Coverage 87.85% 87.89% +0.03%
==========================================
Files 21 21
Lines 766 768 +2
==========================================
+ Hits 673 675 +2
Misses 93 93 ☔ View full report in Codecov by Sentry. |
0262e24
into
flutter-form-builder-ecosystem:main
TASK #1388
Connection with issue(s)
Solution description
Always respect latest field's initial value rather than assigning old field's value (if present)
Screenshots or Videos
To Do