Skip to content
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

FastField doesn't set initial value with type="checkbox" and type="radio" with material-ui #2697

Closed
LeamonLee opened this issue Aug 13, 2020 · 2 comments

Comments

@LeamonLee
Copy link

LeamonLee commented Aug 13, 2020

❓Question

Current Behavior
I'm trying to use FastField with material-ui to avoid unnecessary re-render. A checkbox's and a radio button's initial value are being set, but neither the checkbox nor the radio button display the correct initial status. The following code sandbox link shows that Field works but FastField doesn't. Is there something I miss?

Expected behavior
The checkbox and radio button are supposed to display correctly with corresponding initial value.

Reproducible example
https://codesandbox.io/s/focused-currying-83dbw?file=/src/App.js

Software Version(s)
React 16.12
Formik 2.1.5
Material-ui 4.11.0
Browser Chrome 84.0.4147.125
@LeamonLee
Copy link
Author

LeamonLee commented Aug 18, 2020

I kinda figured out myself. The field that FastField provides doesn't contain 'checked' property, however, the regular Field does.
So my workaround is calculate the value of 'checked' property on my own.

@maddhruv
Copy link
Collaborator

maddhruv commented Nov 9, 2020

Fixed with #2874

Try using the latest version

@maddhruv maddhruv closed this as completed Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants