multiselect
multiselect copied to clipboard
Optgroups are not sorted
Hello,
If you look at this example: https://crlcu.github.io/multiselect/examples/optgroup.html
We have that:
<optgroup label="Swedish Cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
</optgroup>
<optgroup label="German Cars">
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</optgroup>
And when we look at the rendered multiselect, we have this ordering:
Swedish Cars
Saab
German Cars
Audi
Mercedes
So:
- the optgroups are NOT sorted
- the options inside the optgroup are sorted
Is there a way to have the optgroup sorted, and the option sorted at the same time, like that:
German Cars
Audi
Mercedes
Swedish Cars
Saab
Am I missing an option or something ?
Thank you for your help!
Hi @ncelerier
You are right - the default behaviour of this plugin is not sorting optgroup
s - only option
s.
Anyway, I'm happy to accept pull requests from the community.
Ok, thank you for clarifying.