glints-aries 4.0.228 → 4.0.229

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.
@@ -26,13 +26,18 @@ export var Modal = /*#__PURE__*/React.forwardRef(function Modal(_ref, ref) {
26
26
  onBack = _ref.onBack,
27
27
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
28
28
  useEffect(function () {
29
+ if (typeof window === 'undefined' || !window.document) return;
30
+ var enableScroll = function enableScroll() {
31
+ document.body.style.overflow = 'unset';
32
+ };
29
33
  if (isOpen) {
30
- if (typeof window != 'undefined' && window.document) {
31
- document.body.style.overflow = 'hidden';
32
- }
34
+ document.body.style.overflow = 'hidden';
33
35
  } else {
34
- document.body.style.overflow = 'unset';
36
+ enableScroll();
35
37
  }
38
+ return function () {
39
+ enableScroll();
40
+ };
36
41
  }, [isOpen]);
37
42
  if (!isOpen) {
38
43
  return null;
@@ -33,13 +33,18 @@ var Modal = /*#__PURE__*/_react["default"].forwardRef(function Modal(_ref, ref)
33
33
  onBack = _ref.onBack,
34
34
  props = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
35
35
  (0, _react.useEffect)(function () {
36
+ if (typeof window === 'undefined' || !window.document) return;
37
+ var enableScroll = function enableScroll() {
38
+ document.body.style.overflow = 'unset';
39
+ };
36
40
  if (isOpen) {
37
- if (typeof window != 'undefined' && window.document) {
38
- document.body.style.overflow = 'hidden';
39
- }
41
+ document.body.style.overflow = 'hidden';
40
42
  } else {
41
- document.body.style.overflow = 'unset';
43
+ enableScroll();
42
44
  }
45
+ return function () {
46
+ enableScroll();
47
+ };
43
48
  }, [isOpen]);
44
49
  if (!isOpen) {
45
50
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glints-aries",
3
- "version": "4.0.228",
3
+ "version": "4.0.229",
4
4
  "description": "Glints ui-kit for frontend",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./es/index.js",