Skip to content

submenus will sometimes position off screen #1114

@howudodat

Description

@howudodat

Describe the bug
I have a button at the top of the window with a drop menu. That dropmenu has another dropmenu. The submenu shows offscreen
One screenshot shows the issue, the other I added a bunch of seperators to show the full menu

To Reproduce
Put a menu with submenu and assign to a button at the top of the screen

Expected behavior
submenu should never go above top 0px

Screenshots

Image Image

Sample Code

Menu<String> menuQB = Menu.<String>create()
	.setDropDirection(DropDirection.TOP_MIDDLE)
	;
Menu<String> menuInvoiceAll = Menu.<String>create()
	.setDropDirection(DropDirection.TOP_MIDDLE)
	;


for (JTPmtTerms pt : JTPmtTerms.GetAll()) {
	MenuItem<String> mi = MenuItem.<String>create(pt.toPickerString()).withValue(pt.id + "");
	menuInvoiceAll.appendChild(mi);
}


// default invoice type
menuQB.appendChild(MenuItem.<String>create(pt.toPickerString()).withValue(pt.id + "").appendChild(PrefixAddOn.of(Icons.new_box())));

// other menu options
menuQB.appendChild(MenuItem.<String>create("All Terms").setMenu(menuInvoiceAll));
menuQB.appendChild(Separator.create());
menuQB.appendChild(MenuItem.<String>create("Link Existing Invoice(s)").withValue("existing").appendChild(PrefixAddOn.of(Icons.link_variant())));
menuQB.appendChild(Separator.create());
menuQB.appendChild(MenuItem.<String>create("Re-Sync Invoice(s)").withValue("sync").appendChild(PrefixAddOn.of(Icons.sync())));


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions