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 the radio control checked property #3758

Merged
merged 1 commit into from
Dec 21, 2017

Conversation

stevehenty
Copy link
Contributor

Description

The radio control is currently not displaying the checked value. This PR fixes the issue by changing the selected property to checked.

How Has This Been Tested?

Tested by adding a radio control to an inspector panel. The selected radio button is now displayed correctly when moving away and returning to the panel.

Types of changes

Bug fix

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • [] My code has proper inline documentation.

@@ -32,7 +32,7 @@ function RadioControl( { label, selected, help, instanceId, onChange, options =
name={ id }
value={ option.value }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can safely remove the value prop here, can we?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried removing the value prop but the radio button never gets selected so it seems to be required.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right! I don't know what happened in my testing 🙃

@youknowriad
Copy link
Contributor

Sorry for the delay to review this PR. This got lost in the middle of the huge amount of PRs we have :)
This works well, I have a small comment above, I'd be happy to merge this once addressed.

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix 👍

@youknowriad youknowriad merged commit db193b6 into WordPress:master Dec 21, 2017
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.

2 participants