-
Notifications
You must be signed in to change notification settings - Fork 215
add Radio Groups #99
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
add Radio Groups #99
Conversation
Thanks for the PR. I'll look into this on the weekend. |
Thanks for the PR! It is a logical extension of the current component, and I definitely agree that it would be a useful addition. Disclaimer: I have scanned the file changes from this PR, but have not fully looked at all code changes. From my testing of RadionExample.js, I have noticed a couple issues, one of which is minor and non-blocking:
Honsetly, the issue with point 1 is probably a sympton of the fact that the I might have to spend a little more time thinking about this when I get some extra free time. |
It looks like you have gotten a good idea of what some of the problems are. :) I agree completely with point 2 and had planned to add that. As for point 1, I agree. I have thought about much of those same concerns, even thinking about suggesting changes for a v2.0 replacing the Requiring the radio buttons nodes to be leaves would simplify things and instead of using the radio group checkbox to turn on or off the group, one would be able to "uncheck" a checked radio button and thus have none selected that way. This should work just like the checkboxes with the only change being that sibling radio buttons get turned off when one is turned on. I think going this route may cause problems for expanding to what I have shown in the examples in the future. After more thought, having the radio button nodes as leaves might work if then the child of that leaf could be its own CheckTree. Essentially that is how it is working now except that the What do you think? |
I am closing this PR as it is outdated by changes to V1 since it was submitted and this capability is included in the V2.0 proposal #147. |
This pull request adds Radio Groups to react-checkbox-tree. This allows mutually exclusive options with radio buttons to be used in the tree.
This includes the changes made in #97 and #98. I submitted #97 because some small refactoring was needed to make this work. If you can accept the refactoring in that pull request, then this one makes the same changes.
I have updated the README and the examples. I still need to add some tests.
@jakezatecky, let me know if you will accept this pull request. I need the radio group option and would prefer to not fork your project.
Let me know if you see any changes needed to keep consistent with your project.