@danielgindi/selectbox 1.0.76 → 1.0.78

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 1.0.76
2
+ * @danielgindi/selectbox 1.0.78
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
5
  import { createElement, closestUntil, setElementAttrs, next, prev } from '@danielgindi/dom-utils/lib/Dom';
@@ -607,7 +607,7 @@ class DropList {
607
607
 
608
608
  // Look for the proper item
609
609
  let itemIndex = this.itemIndexByValue(value);
610
- if (itemIndex < -1) return this;
610
+ if (itemIndex === -1) return this;
611
611
 
612
612
  let item = this.itemAtIndex(itemIndex);
613
613
  item[ItemSymbol$1] = newItem;
@@ -656,7 +656,7 @@ class DropList {
656
656
 
657
657
  // Look for the proper item
658
658
  let itemIndex = this.itemIndexByValueOrLabel(value, label);
659
- if (itemIndex < -1) return this;
659
+ if (itemIndex === -1) return this;
660
660
 
661
661
  let spliced = p.items.splice(itemIndex, 1);
662
662
  if (spliced[0]._group) {
@@ -5634,6 +5634,11 @@ class SelectBox {
5634
5634
  if (group.length === 0 || (group.length === 1 && group[0]._group)) {
5635
5635
  groups.splice(g--, 1);
5636
5636
  glen--;
5637
+
5638
+ let sgi = uncheckedGroups.indexOf(group);
5639
+ if (sgi !== -1) {
5640
+ uncheckedGroups.splice(sgi, 1);
5641
+ }
5637
5642
  }
5638
5643
  }
5639
5644
  }