@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/dist/lib.es6.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @danielgindi/selectbox 2.0.32
2
+ * @danielgindi/selectbox 2.0.34
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
5
  import { createElement, closestUntil, setElementAttrs, next, prev } from '@danielgindi/dom-utils/lib/Dom';
@@ -3866,7 +3866,7 @@ class SelectBox {
3866
3866
  * @returns {boolean}
3867
3867
  */
3868
3868
  isReadOnly() {
3869
- return !this._p.readOnly;
3869
+ return this._p.readOnly;
3870
3870
  }
3871
3871
 
3872
3872
  /**
@@ -6686,16 +6686,20 @@ class SelectBox {
6686
6686
 
6687
6687
  let group = [], stickyGroup = null;
6688
6688
  let groups = [group];
6689
+ let inGroup = false;
6689
6690
  const selectedValuesSet = new Set(p.selectedValues);
6690
6691
  let item, i, len;
6691
6692
 
6692
6693
  // Split to groups
6693
6694
  for (i = 0, len = items.length; i < len; i++) {
6694
6695
  item = items[i];
6695
- if (item._group && group.length) {
6696
+
6697
+ if ((item._group && group.length) || (inGroup && !item._group && !item._child)) {
6698
+ inGroup = !!item._group;
6696
6699
  group = [];
6697
6700
  groups.push(group);
6698
6701
  }
6702
+
6699
6703
  group.push(item);
6700
6704
  }
6701
6705