You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you submitting a bug report or a feature request?
It's a feature request
Let's say I have a captcha field. When server rejects the form for whatever reason the captcha needs to be cleared and refreshed. It would be nice if redux-form was able to reset the field back to its initial value every time submitting finished with error. To do that right now it would require a special-crafted onSubmit handler which makes it harder to use the form in the scenarios where this handler should be passed down through props. Now it can be done by tracking changes in submitting and submitFailed props of the form in the form component, but that seems unnecessary complicated.
Ideally I would want to be able to add or remove fields like that captcha I used as example without having to heavily modify the form itself. I like my forms as functional components
And then captcha field could be stateful component that would reload itself every time it changes from dirty to prestine... Which can also happen if user just clears the value. Damn
Does this make any sense?
The text was updated successfully, but these errors were encountered:
Detecting changes from dirty to pristine and back to dirty seems over complicated!
I think your issue is quite specific and it can be done more easily if you dispatch an action that increases a counter. Everytime your counter changes, you can render your captcha.
This is possible via onSubmitFailed config.
Are you submitting a bug report or a feature request?
It's a feature request
Let's say I have a captcha field. When server rejects the form for whatever reason the captcha needs to be cleared and refreshed. It would be nice if redux-form was able to reset the field back to its initial value every time submitting finished with error.
To do that right now it would require a special-craftedNow it can be done by tracking changes inonSubmit
handler which makes it harder to use the form in the scenarios where this handler should be passed down through props.submitting
andsubmitFailed
props of the form in the form component, but that seems unnecessary complicated.Ideally I would want to be able to add or remove fields like that captcha I used as example without having to heavily modify the form itself. I like my forms as functional components
Proposed API:
And then captcha field could be stateful component that would reload itself every time it changes from dirty to prestine... Which can also happen if user just clears the value. Damn
Does this make any sense?
The text was updated successfully, but these errors were encountered: