Fix: Do not clear the required default form values on form mount #3659
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
There's a bit of code that resets the default values for any given form whenever a form mounts. In issue #3656, the reason why it says "Not enough tokens" is because the "selectedToken" field value for the Simple Payment form is being cleared on mount. This makes the
hasEnoughFundsValidation()
function trigger the form error because it pretty cannot calculate your funds correctly.This was also causing the issue which Raul raised about the Mint Tokens form -- it's because
selectedToken
is undefined at this point -- it got cleared on mount.For the create domain action, it complains about the
createdIn
field, and same issue, it's because it got cleared on mount.But these changes should make all of those go away and unblock testing on QA 🙏
Testing
Resolves #3656
Resolves #3664