I started to use the new checkbox component in the new app and payed attention to some unwanted behavior. When I click on a parent checkbox it selects/unselects all children, but when I click on children it doesn't affect parent checkbox. Even if unselect all children in one node. Perhaps it is a new unique logic that doesn't feet the old checkbox tree component, but it feels like a bug that causes some issue with requirements to the app I'm working on.
Steps:
Add a new checkbox tree component with option that has children.
Select parent checkbox -> it will automatically select all related children.
Deselect child or all children of the node -> Nothing happens to parent checkbox.
As a result the current value of the checkbox tree still includes the parent.
I can understand, but it sounds especially weird when you uncheck all the children and the parent checkbox is still checked. It is hard to imagine a situation that the user unchecks all subcategories and the parent category is still selected. I have logical and cognitive dissonance regarding such behavior.
Maybe there is an option to disable such relational behavior in Retool?
Hey @MichaelT - thanks for reaching out. You make some interesting points here, but @ScottR is ultimately correct in the sense that the parent is its own selectable entity.
It's not exactly what you're asking for, but you might consider using the Check strictly? toggle in the component settings. This setting decouples the children nodes from their parent, so that parents can be selected independently.
I hope that helps! Let me know if you have any additional questions or comments.
Hi @Darren, thank you for your answer.
I used "Check strictly" toggle and was expecting exactly the behaviour I described above.
I expect that when check strictly mode is off it will automatically change the parent checkbox state, but this is not what happens in fact. So I raised this topic to understand if there is an option to toggle on/off additional settings checkbox that will allow to see such behaviour in the checkbox tree.
Got it. With all that said, then, there is not currently a way to prevent the parent element from being individually selectable.
It does kind of feel like that should be the default behavior, though, given the existence of the Check strictly? option. I'll pass that feedback on to the team and provide an update here as soon as I have news to share!