danielfarrell / bootstrap-combobox

A combobox plugin that works with twitter bootstrap
849 stars 328 forks source link

Call #highlight on different el if bsVersion set to 4 #237

Closed ddknapik closed 7 years ago

ddknapik commented 7 years ago

I propose a small change in render function, which would allow bootstrap-combobox to conform with Bootstrap 4.

The way to create dropdowns in Bootstrap 4 looks as follows:

<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
    <a class="dropdown-item" href="#">Action</a>
    <a class="dropdown-item" href="#">Another action</a>
    <a class="dropdown-item" href="#">Something else here</a>
  </div>

The significant difference is that dropdown items are now not nested in <li> elements, so updating combobox defaults like this:

$.fn.combobox.defaults = {
    bsVersion: '4',
    menu: '<div class="dropdown-menu"></div>',
    item: '<a class="dropdown-item"></button>'
}

is not enough to make it work.