Closed notAro14 closed 3 years ago
Totals | |
---|---|
Change from base Build 425: | 0.0% |
Covered Lines: | 734 |
Relevant Lines: | 734 |
@gentooboontoo @cmigazzi I add the test https://github.com/Kozea/formol/pull/73/commits/8101ebc868cbc1ed4df305fbe07ef8a979b22fb0 for the fix. You can now review.
Context
When two or more Fields are used either inside the Conditional component or both in their own Conditional with the same show condition, only the last Field receive its initial value set in item attribute via Formol component.
The cause
When a Field is mounted, the register function is executed to register the component in transientItem variable. But due to the async nature of setState, the transientItem between Fields registration stays the same.
I think this commit is an attempt to fix the bug https://github.com/Kozea/formol/commit/c12d07cdb293e9012b8062df11dacc25a1c5121e But it seems to appear again https://github.com/Kozea/formol/issues/62