Skip to content

Commit 3c58d6c

Browse files
fastcatchmlh758
authored andcommitted
Fixes height calculation for optgroups (#828)
* Fixes height calculation for optgroups by checking groups and list items separately
1 parent 5ca70ad commit 3c58d6c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/jquery.multiselect.js

100644100755
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,10 @@
585585
_setMenuHeight: function() {
586586
var headerHeight = this.menu.children(".ui-multiselect-header:visible").outerHeight(true);
587587
var ulHeight = 0;
588-
this.menu.find(".ui-multiselect-checkboxes li, .ui-multiselect-checkboxes a").each(function(idx, li) {
588+
this.menu.find(".ui-multiselect-optgroup").each(function(idx, ul) {
589+
ulHeight += $(ul).outerHeight(true);
590+
});
591+
this.menu.find(".ui-multiselect-checkboxes > li").each(function(idx, li) {
589592
ulHeight += $(li).outerHeight(true);
590593
});
591594
if(ulHeight > this.options.height) {

0 commit comments

Comments
 (0)