Describe the solution you'd like
When propagateSelect is on, selecting a parent node triggers onSelect (or some new prop) once instead of for the parent node and every child.
What value does this proposed solution bring to users?
Right now there's no easy way to know when all onSelect events have been fired. You either have to manually track which selected node is the parent and keep track of which children have had their onSelect event fire, or check the treeState.selectedIds and then ignore each subsequent call to onSelect (this is also made more difficult by #190, and keeps us from using the element data). Neither of these solutions feel natural. This becomes a significant issue when running side effects based on tree selection that take time (for example, fetching data from a server).
Describe alternatives you've considered
I've considered onNodeSelect since it would only trigger for the parent node, but it doesn't trigger if the node is selected programmatically. I've also used onBlur, but having to click outside the tree to apply changes makes for bad user experience and it again doesn't trigger for programmatic selections (i.e. a "select all" button).
Describe the solution you'd like
When
propagateSelectis on, selecting a parent node triggers onSelect (or some new prop) once instead of for the parent node and every child.What value does this proposed solution bring to users?
Right now there's no easy way to know when all onSelect events have been fired. You either have to manually track which selected node is the parent and keep track of which children have had their onSelect event fire, or check the
treeState.selectedIdsand then ignore each subsequent call to onSelect (this is also made more difficult by #190, and keeps us from using the element data). Neither of these solutions feel natural. This becomes a significant issue when running side effects based on tree selection that take time (for example, fetching data from a server).Describe alternatives you've considered
I've considered
onNodeSelectsince it would only trigger for the parent node, but it doesn't trigger if the node is selected programmatically. I've also usedonBlur, but having to click outside the tree to apply changes makes for bad user experience and it again doesn't trigger for programmatic selections (i.e. a "select all" button).