Skip to content

Commit

Permalink
[snapappointments#2393] consider custom content for li height computa…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
Mobe91 committed Feb 14, 2020
1 parent 9b50d93 commit fd9ce16
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions js/bootstrap-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,6 @@
menuInnerInner = document.createElement('ul'),
divider = document.createElement('li'),
dropdownHeader = document.createElement('li'),
li = document.createElement('li'),
a = document.createElement('a'),
text = document.createElement('span'),
header = this.options.header && this.$menu.find('.' + classNames.POPOVERHEADER).length > 0 ? this.$menu.find('.' + classNames.POPOVERHEADER)[0].cloneNode(true) : null,
Expand All @@ -1452,8 +1451,15 @@
dropdownHeader.className = 'dropdown-header';

text.appendChild(document.createTextNode('\u200b'));
a.appendChild(text);
li.appendChild(a);

var li;
if (this.selectpicker.current.elements.length > 0) {
li = this.selectpicker.current.elements[0];
} else {
li = document.createElement('li');
a.appendChild(text);
li.appendChild(a);
}
dropdownHeader.appendChild(text.cloneNode(true));

if (this.selectpicker.view.widestOption) {
Expand Down

0 comments on commit fd9ce16

Please sign in to comment.