If a SectionHeading is added to a ComboBox via addSectionHeading ("Heading"); and the ComboBox is used with a ComboBoxAttachment, the chosen choices are off by 1, as a parameter value of 0 will select the heading, and not the first item after the heading.
The behavior was different with 5.4.3, worked like a charm.
I use the section heading for some parameters, where my GUI won’t allow to add the description of the choices next to the ComboBox, like here:
The heading “Number of channels” is select, as the parameter has a default value of 0.
From the docs: The headings are indented slightly differently to set them apart from the items on the list, and obviously can't be selected. ← the last part is not true any more
Especially this line: PopupMenu::Item::Item (String t) : text (std::move (t)), itemID (-1) {}
This constructor sets the itemID for headings to -1, which in general is just fine.
However, this collides with:
which is eventually called in the initialUpdate() call of the ComboBoxAttachment.
So it counts the heading as an element.
Maybe this one should be changed to if (item.itemID > 0)
otherwise also headings can be selected by calls of setSelectedItemIndex