Skip to content

Commit afc5d8c

Browse files
committed
fix: #152 - ignoreDisabled: true does not work with optgroups
1 parent ba4c0e2 commit afc5d8c

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

dist/js/multiselect.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* @license
33
*
4-
* Multiselect v2.5.2
4+
* Multiselect v2.5.3
55
* http://crlcu.github.io/multiselect/
66
*
77
* Copyright (c) 2016-2018 Adrian Crisan
@@ -453,7 +453,13 @@ if (typeof jQuery === 'undefined') {
453453
}
454454

455455
if ($option.is('optgroup')) {
456-
$destinationGroup.move($option.find('option'));
456+
var disabledSelector = '';
457+
458+
if (self.options.ignoreDisabled) {
459+
disabledSelector = ':not(:disabled)';
460+
}
461+
462+
$destinationGroup.move($option.find('option' + disabledSelector));
457463
} else {
458464
$destinationGroup.move($option);
459465
}
@@ -810,4 +816,3 @@ if (typeof jQuery === 'undefined') {
810816
return $(elem).text().match(regex);
811817
}
812818
}));
813-

0 commit comments

Comments
 (0)