@danielgindi/selectbox 1.0.102 → 1.0.103

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.102
2
+ * @danielgindi/selectbox 1.0.103
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
5
  import { createElement, closestUntil, setElementAttrs, next, prev } from '@danielgindi/dom-utils/lib/Dom';
@@ -2573,7 +2573,19 @@ class SelectBox {
2573
2573
 
2574
2574
  if (window.ResizeObserver !== undefined) {
2575
2575
  p.resizeObserver = new ResizeObserver(() => {
2576
+ p.resizeObserver.unobserve(p.el); // avoid ResizeObserver infinite loop
2577
+
2578
+ if (this[DestroyedSymbol])
2579
+ return;
2580
+
2576
2581
  this._resizeInput();
2582
+
2583
+ // avoid ResizeObserver infinite loop - only renew the observation after the new layout has settled
2584
+ requestAnimationFrame(() => {
2585
+ if (this[DestroyedSymbol])
2586
+ return;
2587
+ p.resizeObserver.observe(p.el);
2588
+ });
2577
2589
  });
2578
2590
  p.resizeObserver.observe(p.el);
2579
2591
  }