Prevent ContextMenu closing on outside click

Hello, I have a ContextMenu that has a Select in it. I want to keep the ContextMenu opened until a user clicks a button inside the ContextMenu, but currently the ContextMenu closes when selecting something in the Select or clicking outside of the menu.


Select<PreselectedInterval> timeIntervalSelect = new Select<>();

ContextMenu contextMenu = new ContextMenu(menuIcon);

As you see, Select was added through contextMenu.add() and not contextMenu.addItem(), because it prevents the menu from closing when clicking on a component inside, which works for components such as Checkbox or Button, but not for Select when selecting a value (i’m guessing it detects it as an outside click)… So I am wondering if there is a way to prevent the ContextMenu from closing on outside click?