@jobber/hooks 2.17.0 → 2.17.1

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.
@@ -23,7 +23,17 @@ function useResizeObserver({ widths = exports.Breakpoints, heights = exports.Bre
23
23
  width: undefined,
24
24
  height: undefined,
25
25
  });
26
- const onResize = (0, react_1.useMemo)(() => (0, throttle_1.default)(setSize, wait), [wait]);
26
+ const onResize = (0, react_1.useMemo)(() => {
27
+ return (0, throttle_1.default)(({ width, height }) => {
28
+ if (!width || width <= 1) {
29
+ // Ignore invalid values. ResizeObserver is unexpectedly looping between 1 and the actual
30
+ // width of the element. This is only happening in playwright chromium.
31
+ // Soon we need to replace this unmaintained package with a more reliable one.
32
+ return;
33
+ }
34
+ setSize({ width, height });
35
+ }, wait);
36
+ }, []);
27
37
  const { ref } = (0, polyfilled_1.default)({
28
38
  onResize,
29
39
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/hooks",
3
- "version": "2.17.0",
3
+ "version": "2.17.1",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",
@@ -40,5 +40,5 @@
40
40
  "@apollo/client": "^3.0.0",
41
41
  "react": "^18.2.0"
42
42
  },
43
- "gitHead": "5b2a570f0d657e82d04a8d60964242f67da3fab0"
43
+ "gitHead": "1ee9814294da2a6e858b1472a8b5b0ccffa85330"
44
44
  }