@danielgindi/selectbox 2.0.46 → 2.0.47

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.46
2
+ * @danielgindi/selectbox 2.0.47
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
5
  (function (global, factory) {
@@ -6929,7 +6929,7 @@
6929
6929
  return this;
6930
6930
  }
6931
6931
 
6932
- triggerItemSelection(item, event) {var _item$ItemSymbol3;
6932
+ triggerItemSelection(item, event) {
6933
6933
  const p = this._p;
6934
6934
 
6935
6935
  p.focusItemEl = p.focusItemEl || Dom.closestUntil(event.target, 'li', p.el);
@@ -6942,16 +6942,21 @@
6942
6942
  return false;
6943
6943
  }
6944
6944
 
6945
- if (!p.multi) {
6945
+ if (p.multi) {
6946
+ if (p.focusItemIndex >= 0) {
6947
+ this.toggleFocusedItem();
6948
+ event.preventDefault();
6949
+ }
6950
+ } else {var _item$ItemSymbol3;
6946
6951
  this._setSingleSelectedItemEl(p.focusItemEl);
6947
- }
6948
6952
 
6949
- this._trigger('select', {
6950
- value: item ? item.value : undefined,
6951
- item: (_item$ItemSymbol3 = item[ItemSymbol]) !== null && _item$ItemSymbol3 !== void 0 ? _item$ItemSymbol3 : item,
6952
- event: event,
6953
- el: p.focusItemEl
6954
- });
6953
+ this._trigger('select', {
6954
+ value: item ? item.value : undefined,
6955
+ item: (_item$ItemSymbol3 = item[ItemSymbol]) !== null && _item$ItemSymbol3 !== void 0 ? _item$ItemSymbol3 : item,
6956
+ event: event,
6957
+ el: p.focusItemEl
6958
+ });
6959
+ }
6955
6960
 
6956
6961
  return true;
6957
6962
  }
@@ -8302,7 +8307,7 @@
8302
8307
  }
8303
8308
 
8304
8309
  hasFocusedItem() {
8305
- return this._p.focusItemIndex > -1;
8310
+ return this._p.focusItemIndex > -1 && this._p.focusItemIndex < this._p.items.length;
8306
8311
  }
8307
8312
 
8308
8313
  getFocusedItemIndex() {