iOS: touching sub-menu closes parent PopupMenu

The following commit broke menus for us on iOS.

Now when you tap on a sub-menu it closes the parent menu and the sub-menu so you can’t enter a sub-menu.

Here is a demo of the problem.
SubMenu A should open but the whole thing is closes:

bug

And if I revert that commit here it is working:

working

My feeling is that the whole mouse handling part of the juce popupmenus should be rewritten from scratch, as it is basically impossible to patch it to make it work reliably when the input device is not a mice, or when multiple input devices are co-existing (a touch input, and a mouse, for example).

Especially when submenus are involved. It really should have a different logic for input devices that can “hover” and those that can’t.

1 Like

Yes, exactly! Popupmenus don’t work at all well with touch devices. Really wish they did.

We didn’t have issues yet with them that I recall until the above commit I linked.
Touch, Apple Pencil, and USB mouse all worked until then.

I should have added that I guess it really depends on what you are doing. Simple popupmenus do work just fine. But if you have lots of items and would like to scroll the menu vertically by dragging, or have many nested submenus and a small screen, or want to control the direction in which the menu opens, for example, then things can get tricky. Popupmenus often didn’t work well for what I wanted to do.
The issue you describe seems to be something specific which broke recently. Sorry for the confusion.

2 Likes

To help us with planning, will the broken menus on iOS be fixed soonish?

Thanks!

I’ll see if I can find a fix for the issue, thanks for reporting it.

1 Like

If there is anything I can help test or whatever please feel free to ask.

I’ve done some testing, and sadly don’t see a way for a quick fix.

The PopupMenu is indeed broken on touchscreen displays, that much I can confirm. However I can’t see a difference in behaviour when testing with the “Nested Sub-Menus” part of the Widgets demo, and rolling back 557d690ff. In fact I can’t see a difference in behaviour between the current develop, and as far back as 7.0.0.

The mentioned commit fixes a reproducible bug, so the fix can’t be as simple as reverting that commit either.

Can you confirm, that for your particular use-case rolling back the changes in 557d690ff fixes all observable problems? This will be a useful datapoint, when we get around to a more thorough fix of the PopupMenu class.

Hi Attila,

Here is an attempt at rewriting the mouse handling part of the juce PopupMenu. Hopefully it solves most issues with touch screens, and also with sub-menus:

2 Likes

Can you confirm, that for your particular use-case rolling back the changes in 557d690ff fixes all observable problems?

I just rebuilt our plugins with the HEAD of develop ( LV2 Host: Avoid removing anchors from plugin URIs when loading editors · juce-framework/JUCE@242e93e · GitHub ) and the menu closing issue is still there. Reverting only 557d690ff fixes it.

1 Like

Popup Menus in touch have not worked properly in JUCE ever (in my experience).

I’ve always had to mod it it some way or another to fix stuff