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:
![Click image for larger version
Name: Screenshot 2022-08-29 at 13.14.41.png
Views: 188
Size: 1.5 KB
ID: 268562](filedata/fetch?id=268562&d=1661771733&type=thumb)
First click:
![Click image for larger version
Name: Screenshot 2022-08-29 at 13.14.48.png
Views: 165
Size: 5.6 KB
ID: 268563](filedata/fetch?id=268563&d=1661771733&type=thumb)
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