@julseb-lib/react 1.1.8 → 1.1.10

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-BGER7RTC.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-SUXJNFL6.js.map
@@ -1434,18 +1434,28 @@ 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
+ document.body.style.height = "100vh";
1444
+ }
1441
1445
  }
1442
1446
 
1443
1447
  // src/lib/utils/enable-scroll.ts
1444
1448
  function enableScroll() {
1445
- const body = document.body;
1446
- body.style.height = "";
1447
- body.style.overflow = "";
1448
- return;
1449
+ if (typeof window !== "undefined") {
1450
+ const scrollPosition = document.body.getAttribute(
1451
+ "data-scroll-position"
1452
+ );
1453
+ document.body.style.overflow = "";
1454
+ document.body.removeAttribute("data-scroll-position");
1455
+ if (scrollPosition) {
1456
+ window.scrollTo(0, parseInt(scrollPosition));
1457
+ }
1458
+ }
1449
1459
  }
1450
1460
 
1451
1461
  // src/lib/utils/scroll-to-top.ts
@@ -2062,4 +2072,4 @@ export {
2062
2072
  scrollToTop,
2063
2073
  Image
2064
2074
  };
2065
- //# sourceMappingURL=chunk-2S7ZQK2T.js.map
2075
+ //# sourceMappingURL=chunk-BGER7RTC.js.map