Custom popup item not working on Mac since updating to JUCE 6

Hi,

I have a custom label component which I am adding to a popup menu via addCustomItem(). Up till now, I have been able to open the popup menu and edit the label, but recently I’ve discovered that this feature is now broken and while I can make the label editable, there is no cursor and entering text does not work. I have overridden textEditorTextChanged() and editorShown() to confirm that the editor is being shown but the text editor is not accepting any input. I looked through repo commits to look at code changes which may have broken this, but nothing related to this popup menu or the custom item had been modified. Then I realized that I had just updated to JUCE 6.0.8 before the version that broke so I looked through BREAKING-CHANGES.txt to see if something had been updated which could affect this. The only thing I saw was a few new lookAndFeel methods for the PopupMenu class but nothing that seemed relevant to this custom item. So I reverted to the last version which was working, and after compiling it in JUCE 6 for the first time, the feature no longer worked. This leads me to believe that something in JUCE 6 has broken this feature for mac. I compiled the same code in JUCE 6 on Windows and everything worked as expected. For the record, I have other custom menu items (buttons) in PopupMenus which do work, but for some reason this Label custom item does not.

Does anyone have a clue as to what the issue could be? I have been pulling my hair out trying to get to the bottom of this and am already considering redesigning the menu to not need the label but I prefer not to do this if I can resolve it another way. Any help is greatly appreciated!!

Bump!

Can anyone from the JUCE team weigh in on this? Adding a custom Label component to a PopupMenu does not work on Mac since updating to JUCE 6. This currently works in JUCE 6 (Win) and worked in JUCE 5 (Mac+Win) but it has stopped working in JUCE 6 (Mac). This feature This can easily be reproduced by adding a simple Label to a PopupMenu using addCustomItem(). The label is visible in the menu but cannot be edited. The editor looks to be showing but does not have a cursor and does not accept any input. My plugin has a feature which requires this ability to have an editable label as a PopupMenu item. If this will not be fixed I will need to find an alternative implementation for this feature. Thanks in advance!!

What version of JUCE 5 were you upgrading from? How are you creating and adding the custom component and the corresponding label?

Would it be possible to get a minimal working example? I’ve gone back to JUCE 4.3.1 and I’m still unable to edit the label in a popup. Being able to narrow down what made this work for you using JUCE 5 would be very helpful.

Thank you for the response @t0m!

I upgraded from JUCE 5.4.7 to JUCE 6.1.2. I’ve just rolled back my JUCE version to 5.4.7 and it is working when I test my plugin in Reaper on Mac. It does not appear to work in the standalone plugin version on Mac but my feature was implemented to only be available when running as a plugin (not standalone) so I cannot confirm whether it used to work in the standalone version or not. Below is a minimal example which works for all versions of JUCE on Windows (standalone & plugin), as well as JUCE 5.4.7 and below on Mac (plugin only).

void buttonClicked(Button* button) override
{
    if (button == &exampleButton)
    {
        exampleLabel.setEditable(true);
        PopupMenu menu;
        menu.addCustomItem(1, exampleLabel, 75, 20, false, nullptr);
        menu.showMenuAsync(PopupMenu::Options(), nullptr);
    }
}

...

Label exampleLabel;
TextButton exampleButton;

As mentioned, I tested this on Mac with JUCE 6.1.6, 6.1.2, 5.4.7 and it only works with JUCE 5.4.7 when run as a plugin in a DAW (tested Reaper). The standalone version does not appear to work on Mac but I do not know whether this is old or new because I have never tested this feature on the standalone version until today. I tested this on Windows with JUCE 6.1.6, 6.1.2, 5.4.7 and it works with every version of JUCE when run as a plugin or standalone. Hopefully this is enough to point you in the right direction but please let me know if there is any more I can do. I am working towards a new major release of my mac plugin for the coming month(s) and if this cannot be resolved by then I’ll need to find a new way to implement this feature.

Thanks again!

1 Like
2 Likes

Thank you @t0m! It’s all working now as it used to.