-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
-
-
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
Checkbox doesn't bind to initialValues #1050
Comments
This worked as a workaround for me.
|
This workaround is a little simpler, adding the
|
Hola! So here's the deal, between open source and my day job and life and what not, I have a lot to manage, so I use a GitHub bot to automate a few things here and there. This particular GitHub bot is going to mark this as stale because it has not had recent activity for a while. It will be closed if no further activity occurs in a few days. Do not take this personally--seriously--this is a completely automated action. If this is a mistake, just make a comment, DM me, send a carrier pidgeon, or a smoke signal. |
ProBot automatically closed this due to inactivity. Holler if this is a mistake, and we'll re-open it. |
I think this is still a problem. In the following sandbox, the |
I also think this is still a problem - can't seem to set checkbox initial values using |
Seems that this is being fixed here #1115 |
This is still an issue |
This is pretty sad guys... |
It's out in v2-rc.5 https://github.com/jaredpalmer/formik/releases/tag/v2.0.1-rc.5 |
Updated the initial codesandbox to Formik 2 and React 16.8.6 (something with hooks) https://codesandbox.io/s/formik-v2-field-checkbox-binding-vdvty |
Please suggest work around for checkbox with Field render for formik 1.5.7 |
@prajavk , It works for me: <Field type="checkbox" name="manual-only" id="manual-only" onChange={event => setFieldValue('manualOnly', event.target.checked)} checked={values.manualOnly} /> |
Workaround with react-native
|
Still experience this in formik 1.5.8 Followed @RazerM 's comment and removed |
I have the same problem. Third formik bug I have run into since starting to use the library last week... faith has been shaken. |
Not fixed yet |
Yep, lost an hour or so before realising this is a straight up bug. The |
not fixed yet, however the issue has been closed |
have you checked https://codesandbox.io/s/formik-v2-field-checkbox-binding-vdvty ?? The issue here has long been fixed so far as I can tell, you may be having a similar but unrelated issue, so feel free to open a new issue with a codesandbox reproduction. Even if the issue is it's broken in a "future" version, that's not the same as this issue which was for v1. |
This is how i am using it with material UI and its working fine. the initial value is present in field.value so i assigned it checked property of checkbox.
|
This worked well for me:
FormikModel:
|
I was having this issue with a checkbox group, so I'm leaving this here in case someone else has the same problem and google brings them here. This also uses material ui:
|
Still an issue, initial values not being honoured for checkbox. |
Still an issue on 2.2.9 |
🐛 Bug report
Current Behavior
When using
<Field type="checkbox />
andinitialValues
the checkbox doesn't bind.Expected behavior
<Field type="checkbox" />
should bind toinitialValues
Reproducible example
https://codesandbox.io/s/ppy7wyrl0m
Suggested solution(s)
See #1024
Additional context
See #1024
Your environment
The text was updated successfully, but these errors were encountered: