-
Notifications
You must be signed in to change notification settings - Fork 75
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
get more then value in the handleChange func #53
Comments
In regards to getting more information passed to handleChange()... I'm not 100% sure if this is good practice, but you can interrogate the following property in the DOM and it appears to have the correct GroupName::name...
|
Thanks @marvincolgin! That worked for me. Although it does feel very "hacky". I'm hoping I can eventually find a better way like passing the actual input RadioGroup name to the function. |
OK, so I was playing around with this some more and I think I figured out a better way. This is what worked for me.
And here is my handleRadioChange:
And if anyone is curious about where setUserInput is coming from:
I could be wrong here, but I think ultimately, it should be the job of the RadioGroup onChange handler to automatically pass the name along with the value. Would this be very hard to add into the library? I would think it would be the second parameter so the user could just ignore it in the function if they don't need it. |
I have dynamically outputed radio groups, every group gets unique name.
in the handleChange func I need get the name in addition to value. my state is a pair of
{ {groupName} : {selectedValue} }
there's a way to get the name somehow?
The text was updated successfully, but these errors were encountered: