Perspective Tree - No component event to detect item expanded?

The Perspective Accordion component has an onItemExpanded component event, but the Perspective Tree doesn't. It looks like there is only onItemClicked, which doesn't fire when the branch node is expanded. Is there any way to gracefully detect that a tree's node has been expanded?

For context, I am looking to build a tree's items dynamically using API calls to get each tree level as the user navigates. The source of the data is tens-of-millions of pieces of equipment in SAP, so rather than build a massive tree with a bunch of nodes the user doesn't care about, and in order to be efficient, I only want to add to the tree's items property as the user expands a node. Once a node is expanded, I would like to call an API to get the children and update the tree only for the expanded node.

I'm currently exploring using the onItemClicked and programmatically expanding the node, but it feels hacky because I have to click the label of the node for it to fire, which is not intuitive for users who are used to clicking the expand icon.

2 Likes