简体   繁体   中英

Bug with optgroup in bootstrap-select

When i click on option in optgroup, all option in other optgroup are selected too:

    <select id="ressource_regions_region_id" multiple>
      <optgroup label="one-three">
        <option>One</option>
        <option>two</option>
        <option>three</option>
      </optgroup>
      <optgroup label="four-six">
        <option>four</option>
        <option>five</option>
        <option>six</option>
      </optgroup>
      <optgroup label="seven-nine">
        <option>sevent</option>
        <option>eight</option>
        <option>nine</option>
      </optgroup>
    </select>

In js:

$('#ressource_regions_region_id').selectpicker();

Like this: bug bootstrap-select

Try adding value for options..

<optgroup label="one-three">
    <option value="One">One</option>
    <option value="two">two</option>
    <option value="three">three</option>
</optgroup>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM