yet-another-react-lightbox 2.2.7 → 2.3.0
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.
|
@@ -140,6 +140,13 @@ export const ZoomContainer = ({ slide, offset, rect, render, carousel, animation
|
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
}, [offset, zoom, maxZoom, isMinZoom, isMaxZoom, setIsMinZoom, setIsMaxZoom]);
|
|
143
|
+
const onZoomCallback = useEventCallback(() => {
|
|
144
|
+
var _a;
|
|
145
|
+
if (offset === 0) {
|
|
146
|
+
(_a = on.zoom) === null || _a === void 0 ? void 0 : _a.call(on, zoom);
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
useLayoutEffect(onZoomCallback, [zoom, onZoomCallback]);
|
|
143
150
|
const translateCoordinates = React.useCallback((event) => {
|
|
144
151
|
if (controllerRef.current) {
|
|
145
152
|
const { pageX, pageY } = event;
|