Please consider the following example:
When the toolstripbutton is clicked on the first time, the menu does not appear on top of it, as i would have expected, but rather above it, occluding it. If i hide it and then click the button again, it works as expected.
Seems like a bug? Is there a workaround? Thanks in advance, screenshots to save you time below:
Initial:
First click:
Second click:
Code:
public void onModuleLoad(){ Menu menu = new Menu(); menu.addItem(new MenuItem("Use")); menu.addItem(new MenuItem("The")); menu.addItem(new MenuItem("Fork")); menu.addItem(new MenuItem("Lucy")); ToolStrip strip = new ToolStrip(); strip.setWidth100(); ToolStripButton button = new ToolStripButton("Show"); strip.addButton(button); button.addClickHandler(clickEvent ->menu.showNextTo(button, "top")); Layout main = new VLayout(); main.setAlign(VerticalAlignment.CENTER); main.setWidth100().setHeight100(); main.addMember(strip); main.draw(); }
Seems like a bug? Is there a workaround? Thanks in advance, screenshots to save you time below:
Initial:
First click:
Second click:
Comment