-
Notifications
You must be signed in to change notification settings - Fork 1
Checkbox RAC component #90
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
Conversation
@jomcarvajal I am hesitant to include another checkbox component, can you expand on what you found regarding them selecting/unselecting in the tree? I think we will need to discuss this some more |
Sure! RAC components work in their own context so all components are ready to work together speaking of a11y features. Now, we can use other Checkbox than the RAC option for sure but that implies several workarounds how I did before. So to be clear with this new checkbox, slot='selection' logic only works using the tree and checkbox from RAC because they have all the setup to do it. This components "understand" each other by default. |
Thanks for the additional info, and what's the difference between the check and selection slots? |
Hard to say, the just took selection as their binding I guess https://react-spectrum.adobe.com/react-aria/Tree.html#treeitem:~:text=Concepts-,%23,-Tree%20makes%20use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we need a RAC checkbox to make the tree work, let's not make this generic, I think we'll get it confused with our other checkbox and that could lead to issues. Let's make a tree component folder and place it there, and call it tree checkbox or something. Let's also share as much css as possible (I see you already moved some into a shared file.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a little outside of the scope of this change, but can you add a tree selection change handler in the Tree story? Would be good to see it working as an example implementation. Right now nothing gets checked, it just collapses/expands the children.
New Checkbox created using RAC component. I did'ny modify the old one in case that could break the experience in other parts. The reason of use RAC Checkbox is to use the RAC context and providers already implemented by them. In this case, without their Checkbox, Tree component is not capable of select/unselect checkboxes correctly.