Skip to content

Commit 5610698

Browse files
BrendaHmlh758
authored andcommitted
Prevent unwanted hiding of optgroups after refresh (#762)
Fix same bug as was reported in issue #154. This original bug was fixed in commit 47854a0 (fix for hiding/showing optgroups when optionlist is hidden) but reintroduced in commit a9fcf40 (Option Groups are now ul elements instead of additional list items. )
1 parent 0defc5d commit 5610698

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/jquery.multiselect.filter.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@
175175
// show/hide optgroups
176176
$groups.each(function() {
177177
var $this = $(this);
178-
if(!$this.children("li:visible").length) {
178+
// check with a function on display:none css instead of using :visible selector because newly created
179+
// (on refresh) items are by default not (yet) visible but not hidden on purpose with the display:none.
180+
if(!$this.children('li').filter(function () { return $.css(this, "display") !== 'none' }).length) {
179181
$this.hide();
180182
}
181183
});

0 commit comments

Comments
 (0)