@danielgindi/selectbox 2.0.32 → 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.32
2
+ * @danielgindi/selectbox 2.0.33
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
5
  'use strict';
@@ -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