PopUp Menu Over Combobox

Hello everyone,

I’m encountering an issue with the appearance of my ComboBox/Popup’s look and feel.

I’ve adjusted the target area to be slightly larger than the ComboBox, aiming for the popup to appear with a slight vertical offset either above or below the ComboBox.

This approach works well for PopupMenus where the content height is less than the popup height. However, in cases where the popup’s content height exceeds its height, activating the scroll zone, the popup appears directly over the ComboBox instead of below or above it after clicking.

Is there a way to address this issue without modifying the popup class?

Honestly, my advice having struggled with these kinds of issues recently, is to never use popup menus or any other UI paradigm that involves Parent/Child sub-window relationship. Instead, use sliding drawers and integrated components for your needs. Popup menus and ComboBox menus are sub-windows to the main parent window context, and this relationship is where things are going wrong with the offsets and so on… and, worse, the behaviour will be different across different OS environments and plugin formats.

So, stand back from this, run away from ComboBox and PopupMenu, and instead integrate a sliding drawer Component for your needs. You’ll find it produces a far better user experience.

(Sorry if this is frustrating advice, just take it as a warning and proceed with caution… here be dragons!)

2 Likes

I have also been there… An alternative is to create your own custom ComboBox or PopMenu classes and make them draw in the same component where they are added (which is basically equivalent to a sliding drawer but without the sliding :wink: )

I wish JUCE came with a ComboBox and a PopMenu with this paradigm. This could also be extended to warning/error windows (see another recent post with similar problems).

How about adding this as a feature request?

1 Like

JUCE does have components onboard that can be used like a ComboBox or PopupMenu, already. AlertWindow, etc. Check the DialogsDemo module of the DemoRunner and take particular note of what happens when you toggle the “Use Native Windows” checkbox …

1 Like