@danielgindi/selectbox 1.0.102 → 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.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @danielgindi/selectbox 1.0.102
2
+ * @danielgindi/selectbox 1.0.104
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
5
  'use strict';
@@ -10053,8 +10053,31 @@ var SelectBox = /*#__PURE__*/function () {
10053
10053
  p.sink.add(window, 'orientationchange', function () {return _this._resizeInput();});
10054
10054
 
10055
10055
  if (window.ResizeObserver !== undefined) {
10056
- p.resizeObserver = new ResizeObserver(function () {
10057
- _this._resizeInput();
10056
+ var lastSize = {
10057
+ borderBoxSize: {
10058
+ blockSize: null,
10059
+ inlineSize: null
10060
+ },
10061
+ contentBoxSize: {
10062
+ blockSize: null,
10063
+ inlineSize: null
10064
+ }
10065
+ };
10066
+ p.resizeObserver = new ResizeObserver(function (entries) {
10067
+ if (_this[DestroyedSymbol])
10068
+ return;
10069
+
10070
+ var entry = entries[0];
10071
+ if (!lastSize ||
10072
+ entry.borderBoxSize[0].blockSize !== lastSize.borderBoxSize.blockSize ||
10073
+ entry.borderBoxSize[0].inlineSize !== lastSize.borderBoxSize.inlineSize ||
10074
+ entry.contentBoxSize[0].blockSize !== lastSize.contentBoxSize.blockSize ||
10075
+ entry.contentBoxSize[0].inlineSize !== lastSize.contentBoxSize.inlineSize) {
10076
+ _this._resizeInput();
10077
+ }
10078
+
10079
+ lastSize.borderBoxSize = entry.borderBoxSize[0];
10080
+ lastSize.contentBoxSize = entry.contentBoxSize[0];
10058
10081
  });
10059
10082
  p.resizeObserver.observe(p.el);
10060
10083
  }