@antscorp/antsomi-ui 1.3.5-beta.294 → 1.3.5-beta.295
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.
|
@@ -40,24 +40,6 @@ export const useListingItemResize = (props) => {
|
|
|
40
40
|
}
|
|
41
41
|
return DEFAULT_RATIO;
|
|
42
42
|
}, [containerWidth, gap, initialWidth, itemPerRow]);
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
let timeoutAfterChange = null;
|
|
45
|
-
const handleResize = () => {
|
|
46
|
-
if (timeoutAfterChange) {
|
|
47
|
-
clearTimeout(timeoutAfterChange);
|
|
48
|
-
}
|
|
49
|
-
timeoutAfterChange = setTimeout(() => {
|
|
50
|
-
forceUpdate();
|
|
51
|
-
}, 500);
|
|
52
|
-
};
|
|
53
|
-
window.addEventListener('resize', handleResize);
|
|
54
|
-
return () => {
|
|
55
|
-
window.removeEventListener('resize', handleResize);
|
|
56
|
-
if (timeoutAfterChange) {
|
|
57
|
-
clearTimeout(timeoutAfterChange);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
}, [forceUpdate]);
|
|
61
43
|
useEffect(() => {
|
|
62
44
|
var _a;
|
|
63
45
|
const element = (_a = document.getElementsByClassName('template-listing-container')) === null || _a === void 0 ? void 0 : _a[0];
|
|
@@ -68,7 +50,7 @@ export const useListingItemResize = (props) => {
|
|
|
68
50
|
}
|
|
69
51
|
timeoutAfterChange = setTimeout(() => {
|
|
70
52
|
forceUpdate();
|
|
71
|
-
},
|
|
53
|
+
}, 0);
|
|
72
54
|
};
|
|
73
55
|
const resizeObserver = new ResizeObserver(handleResize);
|
|
74
56
|
if (element)
|