@danielgindi/selectbox 1.0.128 → 1.0.130

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 1.0.128
2
+ * @danielgindi/selectbox 1.0.130
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
5
  'use strict';
@@ -3465,9 +3465,9 @@ class DropList {
3465
3465
 
3466
3466
  // If it's not in the direction that the user expected, invert it
3467
3467
  let invertYPos =
3468
- position.specY === 'top' && newDirection === 'above' ||
3469
- position.specY === 'bottom' && newDirection === 'below' ||
3470
- position.specY !== 'bottom' && position.specY !== 'top' && newDirection === 'above';
3468
+ position.ySpec === 'top' && newDirection === 'above' ||
3469
+ position.ySpec === 'bottom' && newDirection === 'below' ||
3470
+ position.ySpec !== 'bottom' && position.ySpec !== 'top' && newDirection === 'above';
3471
3471
 
3472
3472
  let scrollLeft =
3473
3473
  w.pageXOffset !== undefined ?
@@ -3511,10 +3511,10 @@ class DropList {
3511
3511
  }
3512
3512
 
3513
3513
  if (p.autoFlipDirection) {
3514
- if (position.specX === 'right' &&
3514
+ if (position.xSpec === 'right' &&
3515
3515
  viewCss.left < minX &&
3516
3516
  (Math.max(viewCss.left, minX) + viewSize.width - targetBox.left) / targetBox.width > 0.5 ||
3517
- position.specX === 'left' &&
3517
+ position.xSpec === 'left' &&
3518
3518
  viewCss.left > maxX &&
3519
3519
  (Math.min(viewCss.left, maxX) - targetBox.left) / targetBox.width < 0.5) {
3520
3520
  viewCss.left -= anchor.left - position.left;
@@ -3899,6 +3899,12 @@ class DropList {
3899
3899
  }).
3900
3900
  on('subitems:select', (event) => {
3901
3901
  this._trigger('subitems:select', event);
3902
+ }).
3903
+ on('_back_key_pressed', () => {
3904
+ this._hideSublist();
3905
+
3906
+ if (!this[DestroyedSymbol$1])
3907
+ this.el.focus();
3902
3908
  });
3903
3909
 
3904
3910
  droplist.setItems(item._subitems);
@@ -4322,6 +4328,8 @@ class DropList {
4322
4328
  if (p.currentSubDropList) {
4323
4329
  this._hideSublist();
4324
4330
  preventDefault = false;
4331
+ } else {
4332
+ this._trigger('_back_key_pressed');
4325
4333
  }
4326
4334
  }
4327
4335
  break;