Dropdownlist problem when group label is the same as option value

Hi there i ran into a problem.

I was generating options for dropdowns using the function Html::renderSelectOptions()

Now i discoverd that i can not use option groups with a label that is the same as the value of a normal option.

The lists i use are combinations of optiongroups and options.

The result needs to be rendered like this:




<option value='one'>Option one</option>

<option value='two'>Option two</option>

<option value='three'>Option three</option>

<optgroup label='one'>

<option value='four'>Option four is in an optgroup</option>

<option value='five'>Option five is in an optgroup</option>

</optgroup>

<option value='six'>Option six</option>

<option value='seven'>Option six</option>



Problem is that the function renderSelectOptions takes the array keys as value for the option or label for an optgroup. So that means i can never have an option group that has the same label as an option ?

That also concludes an other logical error here.

Theoretically it should be possible to have two options with the same value but with different labels.

However if i look at the logic of this function than it seems it wont be possible to do that.

How can i / we solve this :)

Greetz Luuc25

No one who has got an idea on how to fix this :mellow: ?