@danielgindi/selectbox 1.0.137 → 1.0.138

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.137
2
+ * @danielgindi/selectbox 1.0.138
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
5
  import { createElement, closestUntil, setElementAttrs, next, prev } from '@danielgindi/dom-utils/lib/Dom';
@@ -1561,7 +1561,7 @@ class DropList {
1561
1561
  let itemPos, previousPos = -1;
1562
1562
  let maxIterations = 30; // Some zoom/scroll issues can make it so that it takes almost forever
1563
1563
 
1564
- // eslint-disable-next-line no-constant-condition
1564
+
1565
1565
  while (maxIterations-- > 0) {
1566
1566
  itemPos = p.virtualListHelper.getItemPosition(itemIndex);
1567
1567
 
@@ -2099,7 +2099,7 @@ class DropList {
2099
2099
  let base = getElementOffset(p.focusItemEl).top;
2100
2100
  let height = getElementHeight(p.el, true);
2101
2101
 
2102
- while (true) { // eslint-disable-line no-constant-condition
2102
+ while (true) {
2103
2103
  next = p.focusItemEl.nextElementSibling;
2104
2104
  if (!next) return;
2105
2105
  if (next.tagName !== 'LI') continue;
@@ -2919,6 +2919,20 @@ class SelectBox {
2919
2919
  return this._p.el;
2920
2920
  }
2921
2921
 
2922
+ get droplistInstance() {
2923
+ return this._p.dropList;
2924
+ }
2925
+
2926
+ /**
2927
+ * Returns true if other is an inclusive descendant of droplist node, false otherwise, and undefined if the droplist is not initiated.
2928
+ * @param {Node} other
2929
+ * @param {boolean} [considerSubmenus=true]
2930
+ * @returns {boolean|undefined}
2931
+ */
2932
+ droplistElContains(other, considerSubmenus = true) {
2933
+ return this._p.dropList?.elContains(other, considerSubmenus);
2934
+ }
2935
+
2922
2936
  /**
2923
2937
  * Enables the control
2924
2938
  * @param {boolean=true} enabled Should the control be enabled?