@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.umd.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
  (function (global, factory) {
@@ -10103,7 +10103,7 @@
10103
10103
  p.multiItemEls = [];
10104
10104
 
10105
10105
  this.enable(!p.disabled);
10106
- this.setReadOnly(!p.readOnly);
10106
+ this.setReadOnly(p.readOnly);
10107
10107
 
10108
10108
  this._setupDropdownMenu();
10109
10109
 
@@ -12671,10 +12671,10 @@
12671
12671
  DomCompat.toggleClass(p.el, "".concat(p.baseClassName, "__has_selection"), p.selectedValues.length > 0);
12672
12672
 
12673
12673
  if (p.searchable) {
12674
- if (p.input) p.input.readOnly = false;
12674
+ if (p.input) p.input.readOnly = p.readOnly;
12675
12675
  p.el.classList.add("".concat(p.baseClassName, "__searchable"));
12676
12676
  } else {
12677
- if (p.input) p.input.readOnly = p.readOnly;
12677
+ if (p.input) p.input.readOnly = true;
12678
12678
  p.el.classList.remove("".concat(p.baseClassName, "__searchable"));
12679
12679
  }
12680
12680
 
@@ -13173,16 +13173,20 @@
13173
13173
 
13174
13174
  let group = [],stickyGroup = null;
13175
13175
  let groups = [group];
13176
+ let inGroup = false;
13176
13177
  const selectedValuesSet = new Set(p.selectedValues);
13177
13178
  let item, i, len;
13178
13179
 
13179
13180
  // Split to groups
13180
13181
  for (i = 0, len = items.length; i < len; i++) {
13181
13182
  item = items[i];
13182
- if (item._group && group.length) {
13183
+
13184
+ if (item._group && group.length || inGroup && !item._group && !item._child) {
13185
+ inGroup = !!item._group;
13183
13186
  group = [];
13184
13187
  groups.push(group);
13185
13188
  }
13189
+
13186
13190
  group.push(item);
13187
13191
  }
13188
13192