@danielgindi/selectbox 2.0.32 → 2.0.34

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/lib/SelectBox.js CHANGED
@@ -556,7 +556,7 @@ class SelectBox {
556
556
  * @returns {boolean}
557
557
  */
558
558
  isReadOnly() {
559
- return !this._p.readOnly;
559
+ return this._p.readOnly;
560
560
  }
561
561
 
562
562
  /**
@@ -3376,16 +3376,20 @@ class SelectBox {
3376
3376
 
3377
3377
  let group = [], stickyGroup = null;
3378
3378
  let groups = [group];
3379
+ let inGroup = false;
3379
3380
  const selectedValuesSet = new Set(p.selectedValues);
3380
3381
  let item, i, len;
3381
3382
 
3382
3383
  // Split to groups
3383
3384
  for (i = 0, len = items.length; i < len; i++) {
3384
3385
  item = items[i];
3385
- if (item._group && group.length) {
3386
+
3387
+ if ((item._group && group.length) || (inGroup && !item._group && !item._child)) {
3388
+ inGroup = !!item._group;
3386
3389
  group = [];
3387
3390
  groups.push(group);
3388
3391
  }
3392
+
3389
3393
  group.push(item);
3390
3394
  }
3391
3395
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielgindi/selectbox",
3
- "version": "2.0.32",
3
+ "version": "2.0.34",
4
4
  "description": "A collection of dom utilities. So you can work natively with the dom without dom frameworks.",
5
5
  "main": "dist/lib.cjs.min.js",
6
6
  "module": "lib/index.js",