Skip to content

Optgroups are not sorted #204

@ncelerier

Description

@ncelerier

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!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions