'How to use selectpicker and filter typing text

I implemented selectpicker to style select but I have no idea how to add filtering by type text like in select2. Does anyone have got idea how to do it ?



Solution 1:[1]

Do you mean grouping options by some parentgroup?

Like this?

<select>
  <optgroup label="Alaskan/Hawaiian Time Zone">
    <option value="AK">Alaska</option>
    <option value="HI">Hawaii</option>
  </optgroup>
</select>

Solution 2:[2]

You can do that with data-live-search prop/attribute setting it to true.

Official link with working examples:

https://developer.snapappointments.com/bootstrap-select/examples/#live-search

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 rishipuri
Solution 2