Tree: Setting the selection closes the context menu


I have a tree where I use an action handler with a context menu to manipulate the entries. Unexpectedly, enabling the context menu for an item does not set the selection to this item which confuses our users (they think the the context menu is in the context of the selected item)

I tried adding a ItemClickListener so that the element that is right clicked element is selected when the context menu is opened (so the user can see which element he manipulates). Unfortunatelty this has the effect that the context menu opens for a very short time only and disappears after a second (when the selection is set).

Does anyone have a solution fo that problem?