# Regression for PopMenu with sub-menu

**URL:** <https://forum.juce.com/t/regression-for-popmenu-with-sub-menu/69655>\
**Category:** MacOSX and iOS\
**Created:** [October 6, 2026, 12:12pm UTC](https://forum.juce.com/t/regression-for-popmenu-with-sub-menu/69655 "2026-10-06T12:12:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpo](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jpo/32/503_2.png) [@jpo](https://forum.juce.com/u/jpo)\
**Post date:** [October 6, 2026, 12:12pm UTC](https://forum.juce.com/t/regression-for-popmenu-with-sub-menu/69655/1 "2026-10-06T12:12:33Z")

</div>

Hi,  
the commit 5fc8d3485d4b41d63beafa30d7f5ba9456e13658 (“_ModalComponentManager (macOS): Raise modal windows to the modal window level_”) caused a regression for long popup menus with sub-menus. On macOS, the submenu will be displayed below the parent menu. It is obvious when the top menu is long enough to be displayed in more than one column, in which case submenus are hidden below their parent.

It can be reproduced in the DemoRunner by changing the `longMenuButton` demo:

```auto
addAndMakeVisible (longMenuButton);
        longMenuButton.onClick = [&]
        {
            PopupMenu menu;

            for (int i = 0; i < 80; ++i) {
                if ((i % 10) == 0)
                {
                    PopupMenu submenu;
                    for (int j=0; j < 20; ++j)
                    {
                        submenu.addItem("xxxxxxx SubItem " + String(j), nullptr);
                    }
                    menu.addSubMenu("SubMenu " + String(i), submenu);
                }
                else
                {
                    menu.addItem ("Item " + String (i), nullptr);
                }
            }
            menu.showMenuAsync (PopupMenu::Options{}.withTargetComponent (longMenuButton));

        };

```

A simple fix is to exclude temporary windows from the patch , for example

```auto
            if (isSharedWindow)
                return {};

+ // fix for regression of juce 9.0.2 commit "Raise modal windows to the modal window level"
+ // submenus of PopupMenu windows appear below the parent PopupMenu
+ if ((getStyleFlags() & ComponentPeer::windowIsTemporary) != 0)
+ return {};

            auto* manager = ModalComponentManager::getInstance();

```

(btw I would suggest that you add such a test-case to DemoRunner as the combinaison of long menu + sub menus (and maybe more than one level of submenu) is the most tricky)

---

<div class="post-metadata">

**Author:** ![t0m](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/t0m/32/16413_2.png) [@t0m](https://forum.juce.com/u/t0m)\
**Post date:** [October 6, 2026, 12:46pm UTC](https://forum.juce.com/t/regression-for-popmenu-with-sub-menu/69655/2 "2026-10-06T12:46:56Z")

</div>

There is a fix for this on the way.

It’s tied into a much bigger piece of work to use native operating system child windows, which will likely take a little while to release.

---

<div class="post-metadata">

**Author:** ![t0m](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/t0m/32/16413_2.png) [@t0m](https://forum.juce.com/u/t0m)\
**Post date:** [October 15, 2026, 12:14pm UTC](https://forum.juce.com/t/regression-for-popmenu-with-sub-menu/69655/3 "2026-10-15T12:14:12Z")

</div>

> [@Native child windows](https://forum.juce.com/t/native-child-windows/69718):
>
> We have just pushed some changes that allow windows created from your app or plug-in to bind to a parent window. This uses a similar convention to that already implemented for things like pop-up menus, where you can set an “associated” component. Windows with an associated parent will do the following: Move with the parent Minimise and restore with the parent Not appear on the taskbar No windows from different apps can be ordered between a child and an associated parent. We have updated JU…
