@helsenorge/lightbox 11.2.0-beta.0 → 11.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.
@@ -1775,10 +1775,8 @@ const LightBox = ({
1775
1775
  const timer = setTimeout(() => {
1776
1776
  setImageTextOpen(false);
1777
1777
  }, closeTextAfterSeconds * 1e3);
1778
- disableBodyScroll();
1779
1778
  return () => {
1780
1779
  clearTimeout(timer);
1781
- enableBodyScroll();
1782
1780
  };
1783
1781
  }, []);
1784
1782
  return /* @__PURE__ */ jsxs(
@@ -1918,6 +1916,12 @@ const Controls = ({
1918
1916
  }, 160);
1919
1917
  }
1920
1918
  };
1919
+ useEffect(() => {
1920
+ disableBodyScroll();
1921
+ return () => {
1922
+ enableBodyScroll();
1923
+ };
1924
+ }, []);
1921
1925
  return /* @__PURE__ */ jsxs("div", { className: classNames(styles$1["zoom-buttons"]), style: { zIndex: ZIndex.LightBoxButtons }, children: [
1922
1926
  /* @__PURE__ */ jsx("button", { className: classNames(styles$1.button), onClick: () => zoomOut2(), "aria-label": ariaLabelZoomOut, children: /* @__PURE__ */ jsx(Icon, { svgIcon: Minus, color: "white", size: IconSize.XSmall }) }),
1923
1927
  /* @__PURE__ */ jsx(MiniSlider, { minValue: 1, maxValue: 4, onChange: adjustZoom, value: zoom, ariaLabel: ariaLabelZoomSlider }),