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 checkbox defaultChecked unexpected changing in form #2135

Merged
merged 3 commits into from
Sep 26, 2024

Conversation

levinqdl
Copy link
Contributor

@levinqdl levinqdl commented May 12, 2023

Description

Fix #2133.

There are two modes to consider: controlled and uncontrolled.

In uncontrolled mode, the defaultChecked property of the input should match the defaultChecked prop of the Checkbox.

In controlled mode, the defaultChecked property of the input should be set to the initial checked state of the Checkbox.

Tests have been added.

@chaance chaance merged commit 25e29c5 into radix-ui:main Sep 26, 2024
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

Successfully merging this pull request may close these issues.

[Checkbox] In a Form, defaultValue of checkbox changes with checked unexpectedly
2 participants