@danielgindi/selectbox 1.0.103 → 1.0.104

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 1.0.103
2
+ * @danielgindi/selectbox 1.0.104
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
5
  (function (global, factory) {
@@ -10049,20 +10049,31 @@
10049
10049
  p.sink.add(window, 'orientationchange', function () {return _this._resizeInput();});
10050
10050
 
10051
10051
  if (window.ResizeObserver !== undefined) {
10052
- p.resizeObserver = new ResizeObserver(function () {
10053
- p.resizeObserver.unobserve(p.el); // avoid ResizeObserver infinite loop
10054
-
10052
+ var lastSize = {
10053
+ borderBoxSize: {
10054
+ blockSize: null,
10055
+ inlineSize: null
10056
+ },
10057
+ contentBoxSize: {
10058
+ blockSize: null,
10059
+ inlineSize: null
10060
+ }
10061
+ };
10062
+ p.resizeObserver = new ResizeObserver(function (entries) {
10055
10063
  if (_this[DestroyedSymbol])
10056
10064
  return;
10057
10065
 
10058
- _this._resizeInput();
10066
+ var entry = entries[0];
10067
+ if (!lastSize ||
10068
+ entry.borderBoxSize[0].blockSize !== lastSize.borderBoxSize.blockSize ||
10069
+ entry.borderBoxSize[0].inlineSize !== lastSize.borderBoxSize.inlineSize ||
10070
+ entry.contentBoxSize[0].blockSize !== lastSize.contentBoxSize.blockSize ||
10071
+ entry.contentBoxSize[0].inlineSize !== lastSize.contentBoxSize.inlineSize) {
10072
+ _this._resizeInput();
10073
+ }
10059
10074
 
10060
- // avoid ResizeObserver infinite loop - only renew the observation after the new layout has settled
10061
- requestAnimationFrame(function () {
10062
- if (_this[DestroyedSymbol])
10063
- return;
10064
- p.resizeObserver.observe(p.el);
10065
- });
10075
+ lastSize.borderBoxSize = entry.borderBoxSize[0];
10076
+ lastSize.contentBoxSize = entry.contentBoxSize[0];
10066
10077
  });
10067
10078
  p.resizeObserver.observe(p.el);
10068
10079
  }