-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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] Fix form submission with empty value #28423
Conversation
@garronej Cool. Could you add a test case for it? With the unstyled effort, we will likely refactor this part of the codebase. |
@oliviertassinari done 👍🏻 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the test case
Sebastian is off, merging as the change is well tested (it fails without the fix) and there is a clear reproduction. @garronej Thanks, well done |
Referencing facebook/react#17590 here which is why we need this workaround. |
Hello,
Mui checkboxes, when used in a
<form>
, don't submit their values.Screen.Recording.2021-09-18.at.15.58.09.mov
Playground link
This is due to the fact that, if we put a
value
prop to the<input />
, even if it'sundefined
, it ends up as an html property and at the time of submiting the form will be interpreted as a void string overriding the checked value.This PR fixes it but maybe it would be better to fix it upstream.
Best regards,
PS: The new landing page is very cool.