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

fix(switch): use defaultChecked instead of checked #2749

Merged
merged 2 commits into from
Sep 6, 2019

Conversation

redallen
Copy link
Contributor

@redallen redallen commented Aug 21, 2019

What: Fixes #2669 and actually changes the <input>'s checked prop in the DOM for our Switch. This is a somewhat tricky React bug, but the solution is to use defaultChecked instead of checked. Setting checked={true} or checked={false} has no effect in the DOM outside of the first render, which is semantically incorrect.

Additional issues:

@patternfly-build
Copy link
Contributor

PatternFly-React preview: https://patternfly-react-pr-2749.surge.sh

@tlabaj tlabaj requested a review from kmcfaul August 28, 2019 17:21
@tlabaj tlabaj assigned tlabaj and kmcfaul and unassigned tlabaj Aug 28, 2019
@tlabaj tlabaj added the PF4 label Aug 28, 2019
kmcfaul
kmcfaul previously approved these changes Aug 29, 2019
@boaz0
Copy link
Member

boaz0 commented Sep 5, 2019

@redallen seems like you need to resolve a conflict or two.

@redallen
Copy link
Contributor Author

redallen commented Sep 6, 2019

Rebased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Turning switch on/off does not change anything in DOM
6 participants