@danielgindi/selectbox 2.0.31 → 2.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lib.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @danielgindi/selectbox 2.0.31
2
+ * @danielgindi/selectbox 2.0.33
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
5
  'use strict';
@@ -10107,7 +10107,7 @@ class SelectBox {
10107
10107
  p.multiItemEls = [];
10108
10108
 
10109
10109
  this.enable(!p.disabled);
10110
- this.setReadOnly(!p.readOnly);
10110
+ this.setReadOnly(p.readOnly);
10111
10111
 
10112
10112
  this._setupDropdownMenu();
10113
10113
 
@@ -12675,10 +12675,10 @@ class SelectBox {
12675
12675
  DomCompat.toggleClass(p.el, "".concat(p.baseClassName, "__has_selection"), p.selectedValues.length > 0);
12676
12676
 
12677
12677
  if (p.searchable) {
12678
- if (p.input) p.input.readOnly = false;
12678
+ if (p.input) p.input.readOnly = p.readOnly;
12679
12679
  p.el.classList.add("".concat(p.baseClassName, "__searchable"));
12680
12680
  } else {
12681
- if (p.input) p.input.readOnly = p.readOnly;
12681
+ if (p.input) p.input.readOnly = true;
12682
12682
  p.el.classList.remove("".concat(p.baseClassName, "__searchable"));
12683
12683
  }
12684
12684
 
@@ -13177,16 +13177,20 @@ class SelectBox {
13177
13177
 
13178
13178
  let group = [],stickyGroup = null;
13179
13179
  let groups = [group];
13180
+ let inGroup = false;
13180
13181
  const selectedValuesSet = new Set(p.selectedValues);
13181
13182
  let item, i, len;
13182
13183
 
13183
13184
  // Split to groups
13184
13185
  for (i = 0, len = items.length; i < len; i++) {
13185
13186
  item = items[i];
13186
- if (item._group && group.length) {
13187
+
13188
+ if (item._group && group.length || inGroup && !item._group && !item._child) {
13189
+ inGroup = !!item._group;
13187
13190
  group = [];
13188
13191
  groups.push(group);
13189
13192
  }
13193
+
13190
13194
  group.push(item);
13191
13195
  }
13192
13196