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 undefined id in RadioButtonGroupInput #3123

Merged
merged 2 commits into from
Apr 13, 2019

Conversation

johncalvinroberts
Copy link
Contributor

@johncalvinroberts johncalvinroberts commented Apr 12, 2019

If no id is passed to RadioButtonGroupInput component, the input is given the id undefined_optionvalue. Consider the case where two fields have the same choices, but different source. They will be given the same id, and the form control labels will interfere, which is not nice.

Updated the component to not put undefined_optionvalue into the id of the node, and added a note to the docs.

Copy link
Contributor

@djhi djhi left a comment

Choose a reason for hiding this comment

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

I think it would be better to generate the id with the source:

`${source}_${get(choice, optionValue)}

It would avoid to explicitly define the id

@johncalvinroberts
Copy link
Contributor Author

Okay, will do

@johncalvinroberts
Copy link
Contributor Author

johncalvinroberts commented Apr 12, 2019

@djhi I replaced with source and removed the ID prop, can still handle backwards compatibility.

If any other changes needed lmk.

@djhi djhi added this to the 2.8.6 milestone Apr 13, 2019
@djhi
Copy link
Contributor

djhi commented Apr 13, 2019

Thanks!

@djhi djhi merged commit 164e258 into marmelab:master Apr 13, 2019
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