How can I reset a radio button when using Formik? #6532
Unanswered
MikeWillis
asked this question in
Q&A
Replies: 2 comments 1 reply
-
Hi, were you able to solve this? Facing same issue. |
Beta Was this translation helpful? Give feedback.
1 reply
-
facing same issue |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a couple of required
RadioGroup
sets in my form. Everything is working fine as far as filling them out, hitting submit, sending the data etc. But after submit I call Formik'sactions.resetForm()
, which clears all fields, but leaves the checked radio inputs checked.Now the fields will be visually checked, but in reality their state is reset to the default, which is empty. However, the user can still hit submit and validation will not be triggered.
The only thing I've come up with so far is to re-render the form entirely. It's ugly though and seems hacky. Has anyone tackled this before and come up with better solution?
Beta Was this translation helpful? Give feedback.
All reactions