-
Notifications
You must be signed in to change notification settings - Fork 91
fix(renderer): Do not override initial values with set values. #1225
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
Conversation
A new version (fix) will be released: v3.16.11 [DataDrivenFormsBot] |
a87e7e5
to
3c7cbfa
Compare
Codecov Report
@@ Coverage Diff @@
## master #1225 +/- ##
=======================================
Coverage 95.15% 95.15%
=======================================
Files 209 209
Lines 3591 3593 +2
Branches 1255 1256 +1
=======================================
+ Hits 3417 3419 +2
Misses 174 174
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
* If the field has an initial value and a conddition setter with positive result, | ||
* do not override initial value with setter values. | ||
*/ | ||
if (!meta.dirty && typeof meta.initial === 'undefined' ? true : meta.initial !== meta.value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be checking modified
instead of dirty so after users change its value, the setter always run (even users go back to the initial value.)
meta.initial !== meta.value
is dirty
otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that would differ from current behavior. If a setter runs and then the user manually changes a field, the seter never overrides the manually changed value. This one is a real head scratcher.
3c7cbfa
to
ff17971
Compare
🎉 This PR is included in version 3.16.11 🎉 The release is available on |
Fixes #1224
Description
Field initial value is being overridden if a set condition is met during initialization phase
Schema (if applicable)
Checklist: (please see documentation page for more information)
Yarn build
passesYarn lint
passesYarn test
passes