@ornikar/kitt-universal 25.29.0 → 25.29.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [25.29.1](https://github.com/ornikar/kitt/compare/@ornikar/kitt-universal@25.29.0...@ornikar/kitt-universal@25.29.1) (2024-10-31)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **kitt-universal:** check if document.body exist on unmount in ModaleBehaviourPortal.web component OSE-13540 ([#2500](https://github.com/ornikar/kitt/issues/2500)) ([3c00f5a](https://github.com/ornikar/kitt/commit/3c00f5a1779bfa8c6acd823e074eb219bb6a28d6))
12
+
13
+
14
+
6
15
  ## [25.29.0](https://github.com/ornikar/kitt/compare/@ornikar/kitt-universal@25.28.0...@ornikar/kitt-universal@25.29.0) (2024-10-30)
7
16
 
8
17
 
@@ -1 +1 @@
1
- {"version":3,"file":"ModalBehaviourPortal.web.d.ts","sourceRoot":"","sources":["../../../src/ModalBehaviour/ModalBehaviourPortal.web.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAoBxE,wBAAgB,oBAAoB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,yBAAyB,GAAG,SAAS,CAQhG"}
1
+ {"version":3,"file":"ModalBehaviourPortal.web.d.ts","sourceRoot":"","sources":["../../../src/ModalBehaviour/ModalBehaviourPortal.web.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAuBxE,wBAAgB,oBAAoB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,yBAAyB,GAAG,SAAS,CAOhG"}
@@ -3717,7 +3717,10 @@ function useBlockBodyScroll(shouldBlockScroll, isInitialRender) {
3717
3717
  document.body.classList.remove(overflowHidden);
3718
3718
  }
3719
3719
  return () => {
3720
- document.body.classList.remove(overflowHidden);
3720
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- When leaving the website, document.body can be null
3721
+ if (document.body) {
3722
+ document.body.classList.remove(overflowHidden);
3723
+ }
3721
3724
  };
3722
3725
  }, [shouldBlockScroll, isInitialRender]);
3723
3726
  }
@@ -3728,9 +3731,7 @@ function ModalBehaviourPortal({
3728
3731
  const isInitialRenderRef = react.useRef(true);
3729
3732
  useBlockBodyScroll(!!visible, isInitialRenderRef.current);
3730
3733
  isInitialRenderRef.current = false;
3731
-
3732
- // eslint-disable-next-line react/jsx-no-useless-fragment -- Portal propTypes define a required children, preventing a null children value
3733
- return children ? /*#__PURE__*/reactDom.createPortal(children, document.body) : /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {});
3734
+ return children ? /*#__PURE__*/reactDom.createPortal(children, document.body) : null;
3734
3735
  }
3735
3736
 
3736
3737
  const OnCloseContext = /*#__PURE__*/react.createContext(() => {});