@julseb-lib/react 1.1.8 → 1.1.9

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Image
3
- } from "./chunk-2S7ZQK2T.js";
3
+ } from "./chunk-VA7LFHRP.js";
4
4
 
5
5
  // src/lib/components/LazyImage/Image.tsx
6
6
  import { jsx } from "react/jsx-runtime";
@@ -11,4 +11,4 @@ var Image_default = Image2;
11
11
  export {
12
12
  Image_default as default
13
13
  };
14
- //# sourceMappingURL=Image-LRQT4MJ6.js.map
14
+ //# sourceMappingURL=Image-MFX5A7HO.js.map
@@ -1434,18 +1434,27 @@ function detectLanguage() {
1434
1434
 
1435
1435
  // src/lib/utils/disable-scroll.ts
1436
1436
  function disableScroll() {
1437
- const body = document.body;
1438
- body.style.height = "100vh";
1439
- body.style.overflow = "hidden";
1440
- return;
1437
+ if (typeof window !== "undefined") {
1438
+ document.body.setAttribute(
1439
+ "data-scroll-position",
1440
+ window.scrollY.toString()
1441
+ );
1442
+ document.body.style.overflow = "hidden";
1443
+ }
1441
1444
  }
1442
1445
 
1443
1446
  // src/lib/utils/enable-scroll.ts
1444
1447
  function enableScroll() {
1445
- const body = document.body;
1446
- body.style.height = "";
1447
- body.style.overflow = "";
1448
- return;
1448
+ if (typeof window !== "undefined") {
1449
+ const scrollPosition = document.body.getAttribute(
1450
+ "data-scroll-position"
1451
+ );
1452
+ document.body.style.overflow = "";
1453
+ document.body.removeAttribute("data-scroll-position");
1454
+ if (scrollPosition) {
1455
+ window.scrollTo(0, parseInt(scrollPosition));
1456
+ }
1457
+ }
1449
1458
  }
1450
1459
 
1451
1460
  // src/lib/utils/scroll-to-top.ts
@@ -2062,4 +2071,4 @@ export {
2062
2071
  scrollToTop,
2063
2072
  Image
2064
2073
  };
2065
- //# sourceMappingURL=chunk-2S7ZQK2T.js.map
2074
+ //# sourceMappingURL=chunk-VA7LFHRP.js.map