@homebound/beam 2.275.1 → 2.275.2
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.
|
@@ -30,10 +30,10 @@ function ScrollShadows(props) {
|
|
|
30
30
|
setShowStartShadow(start > 0);
|
|
31
31
|
setShowEndShadow(start + boxSize < end);
|
|
32
32
|
}, []);
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
// Use a ResizeObserver to update the scroll props to determine if the shadows should be shown.
|
|
34
|
+
// This executes on render and subsequent resizes which could be due to content/`children` changes (such as responses from APIs).
|
|
35
|
+
const onResize = (0, react_1.useCallback)(() => scrollRef.current && updateScrollProps(scrollRef.current), []);
|
|
36
|
+
(0, utils_1.useResizeObserver)({ ref: scrollRef, onResize });
|
|
37
37
|
return ((0, jsx_runtime_1.jsxs)("div", { css: src_1.Css.relative.overflowHidden
|
|
38
38
|
.h(height)
|
|
39
39
|
.w(width)
|