Can't select first item in ComboBox


I’m implementing a simple distortion plugin and utilize a ComboBox for selecting one of four clipping functions. I am experiencing a strange issue where the first item in the drop down can only be selected from the second item. Upon selecting the first item from the third or fourth items in the list, the second item is selected instead. It appears as though when the first item is finally selected, the functionality of the second item is used instead. I had this working in an earlier version and noticed the bug after adding a new knob and reorienting the UI. Any help would be very much appreciated.

If you are using ComboBox::setSelectedID(), you have to make sure, you are using IDs starting from 1, since 0 is used as “undefined”.

If you are using the AudioProcessorValueTree::ComboBoxAttachment, let us know if you are using the latest tip from github, since there was a recent fix, see this thread.

Yeah I’m using the ComboBoxAttachment. Since I’m definitely indexing from 1, I believe this might be the culprit. Let me update my JUCE download and I’ll let you know if this fixed the problem. Thanks!

You’ll have to get the latest version of JUCE from the develop branch on GitHub - the downloads on the JUCE website contain the stable master branch which doesn’t currently contain the changes you need.

Fixed it! Thanks so much @t0m and @daniel!