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 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

This comment has been minimized.

Copy link
Contributor

patternfly-build commented Aug 21, 2019

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

@tlabaj tlabaj requested a review from kmcfaul Aug 28, 2019
@tlabaj tlabaj assigned tlabaj and kmcfaul and unassigned tlabaj Aug 28, 2019
@tlabaj tlabaj added the PF4 label Aug 28, 2019
@boaz0

This comment has been minimized.

Copy link
Member

boaz0 commented Sep 5, 2019

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

@redallen redallen force-pushed the redallen:fix/switch-checked branch from d78d1fe to e9f7bed Sep 6, 2019
@redallen

This comment has been minimized.

Copy link
Contributor Author

redallen commented Sep 6, 2019

Rebased.

@kmcfaul
kmcfaul approved these changes Sep 6, 2019
@jschuler jschuler merged commit 42f7720 into patternfly:master Sep 6, 2019
8 checks passed
8 checks passed
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: build_integration Your tests passed on CircleCI!
Details
ci/circleci: build_pf3_docs Your tests passed on CircleCI!
Details
ci/circleci: build_pf4_docs Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: test_jest_other Your tests passed on CircleCI!
Details
ci/circleci: test_jest_pf4 Your tests passed on CircleCI!
Details
ci/circleci: upload_docs Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.