-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Form reset does not reset checkboxes when using enableReinitialize
#1819
Comments
I'm having this same issue. @DEX3 had you figured out any way to workaround it? |
Nope, we couldn't make reset to work properly, the issue solved itself for us when we started re-rendering the entire |
Having some problem. I have a bunch of custom multi-step forms and on the final step of these forms, you are able to submit the form, but at the end you can also submit and reset, going back to step one. Calling @DEX3 How are you resetting the form? I don't see anywhere to force a re-render with Formik. Are you just using |
Try the latest formik ( |
Well, easiest workaround is using: document.getElementById("gdprId").checked = false;
|
Get same problem, after reset form with useFormik.formReset() check box do reset in state, but dont re-rendered. Solution is just give property checked to your input:
|
🐛 Bug report
Current Behavior
Check this minimal example: https://codesandbox.io/s/formik-checkbox-reset-zyvpd
Right now, this will correctly reset the textbox, but not the checkbox!
Expected behavior
The checkbox should also be reset to the updated initial value
Reproducible example
https://codesandbox.io/s/formik-checkbox-reset-zyvpd
Your environment
The text was updated successfully, but these errors were encountered: