-
Notifications
You must be signed in to change notification settings - Fork 47.3k
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
defaultChecked prop sets only checked attribute #12765
Comments
I also found the same problem, I am now very distressed, ask how to solve? |
This does appear to be a bug: https://codesandbox.io/s/qx0110rpo6 The "checked" attribute is not initially set on the input:
It looks like this has been a bug since 15.0.0. I think we need to add/remove the checked attribute in the post-mount wrapper: |
… the DOM operations.
Fixed by #13114 |
Type
inconsistency
for common use cases.bug
for projects relying on correct DOM emissions.Description
It's unclear to me if the following is a known issue or not.
Take in consideration the snippet below:
Current Behavior
Setting the
defaultValue
prop on inputs of other types sets both thevalue
anddefaultValue
attribute on the DOM element.When setting the
defaultChecked
prop on inputs of typecheckbox
only thechecked
attribute is correctly set, leaving thedefaultChecked
attribute unchanged.Expected Behaviour
Like mentioned above, the expected behavior would be for the
defaultChecked
prop to set both thechecked
anddefaultChecked
attributes on the corresponding DOM node (like it's the case with thedefaultValue
prop).The text was updated successfully, but these errors were encountered: