Using onContextMenu in a Perspective Tree

Hi,

I'm using a Tree in Perspective and i would like to get the data under the cursor where i've right-clicked.

My contextMenu is enabled, and i've added an item "Edit" which send a message "onEditItem". In the payload i've set the props.selectionData[0].value

But the problem is that the selectionData is updated only on a Left-Click, not a Right-Click to show the context menu.

Is there a way to achieve this?

Thanks

Capture the contextmenu event, get the node under the cursor, and manually set selectionData to the clicked node. This ensures the selection is updated even without a left-click, allowing the context menu to work as expected.