Make parent checked when one of its child node is unchecked in TreeView with checkboxes

Hi everyone,
I’m using TreeView with checkboxes in my project and I’m having trouble with the case in the picture

When I unchecked child node Current, I want my result checked item array which will contain 3 items including [Application launcher, Application 1, Settings] instead of 1 items [Settings] like the example in the document PatternFly 4 • Tree view

Can anyone help me with this problem?
Thanks for your help!

Hello! Thank you for your question!
It’s true that the treeview was designed so that the user selects and the event handler returns selected leaf nodes. In your case, since you have the whole data structure at your disposal to build the tree, you would need to determine a leaf node’s ancestors when it is selected to result in the array you’re describing.