@lumx/react 3.8.2-alpha.1 → 3.8.2-alpha.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.
- package/index.js +2 -2
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/image-lightbox/ImageLightbox.test.tsx +10 -18
- package/src/components/image-lightbox/internal/ImageSlide.tsx +2 -2
- package/src/hooks/{useElementSizeDependentOfWindowSize.ts → useSizeOnWindowResize.ts} +1 -3
- package/src/utils/unref.ts +0 -0
package/index.js
CHANGED
|
@@ -7845,7 +7845,7 @@ const CLASSNAME$v = getRootClassName(COMPONENT_NAME$y);
|
|
|
7845
7845
|
* @param elementRef Element to observe
|
|
7846
7846
|
* @return the size and a manual update callback
|
|
7847
7847
|
*/
|
|
7848
|
-
function
|
|
7848
|
+
function useSizeOnWindowResize(elementRef) {
|
|
7849
7849
|
const [size, setSize] = React.useState(null);
|
|
7850
7850
|
const updateSize = React.useMemo(() => throttle(() => {
|
|
7851
7851
|
var _elementRef$current;
|
|
@@ -8109,7 +8109,7 @@ const ImageSlide = /*#__PURE__*/React.memo(props => {
|
|
|
8109
8109
|
|
|
8110
8110
|
// Get scroll area size
|
|
8111
8111
|
const scrollAreaRef = React.useRef(null);
|
|
8112
|
-
const [scrollAreaSize, updateSize] =
|
|
8112
|
+
const [scrollAreaSize, updateSize] = useSizeOnWindowResize(scrollAreaRef);
|
|
8113
8113
|
React.useEffect(() => {
|
|
8114
8114
|
// Update size when active
|
|
8115
8115
|
if (isActive) updateSize();
|