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

ReactLink for radio buttons (radioLink) #3591

Closed
wants to merge 4 commits into from
Closed

ReactLink for radio buttons (radioLink) #3591

wants to merge 4 commits into from

Conversation

guybenron
Copy link

Adresses #3573 .

I modified LinkedValueUtils.js to add support for the following syntax:

<input type="radio" name="mygroup" value="value1" radioLink={this.linkState("myval")}/>
<input type="radio" name="mygroup" value="value2" radioLink={this.linkState("myval")}/>

State will have a variable named myval that will hold the radio buttons value attribute (e.g., value1 or value2). Setting this state variable to a specific value will cause the corresponding radio button to be selected. If there is no corresponding radio button, all will be deselected.

Also updated documentation.

@guybenron
Copy link
Author

So ummmm... what's the next step?

@tobia
Copy link

tobia commented May 18, 2015

I'm already using this patch, so I hope it will be merged soon

@guybenron maybe they are waiting for you to solve the merge conflicts

@syranide
Copy link
Contributor

#2302, ReactLink is probably going to be deprecated so possibly never, but that's not my call. You can easily provide your own enhanced input-component wrapper which provides this behavior rather than having it be supported by React core, that's my recommendation.

PS. It really should be called checkedLink (the property is called checked), not radioLink.

@sebmarkbage
Copy link
Collaborator

Yea, sorry. ReactLink is getting deprecated. I recommend that you implement a wrapper component and publish it to npm.

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.

6 participants