I think because these items aren't `<optgroup>`'s but whatever elements the template renders (eg an `<li class="groupClass">`).

You have a point on the brittleness of this, perhaps there needs to be some validation of `groupClass` that it doesn't clash with the `option`s? The multiple classnames can be worked around as well