@sima-land/ui-nucleons 44.2.4 → 44.2.5
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/_internal/body-scroll.js +2 -2
- package/hooks/index.d.ts +1 -1
- package/package.json +1 -1
package/_internal/body-scroll.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.allowTouchMove = exports.useBodyScrollLock = void 0;
|
|
4
4
|
const body_scroll_lock_1 = require("body-scroll-lock");
|
|
5
|
-
const react_1 = require("react");
|
|
6
5
|
const constants_1 = require("../constants");
|
|
6
|
+
const hooks_1 = require("../hooks");
|
|
7
7
|
/**
|
|
8
8
|
* Хук управления блокировкой прокрутки body.
|
|
9
9
|
* @param ref Реф элемента для которого нужно отключить прокрутку body.
|
|
@@ -11,7 +11,7 @@ const constants_1 = require("../constants");
|
|
|
11
11
|
* @param options Опции.
|
|
12
12
|
*/
|
|
13
13
|
const useBodyScrollLock = (ref, needDisable, options) => {
|
|
14
|
-
(0,
|
|
14
|
+
(0, hooks_1.useIsomorphicLayoutEffect)(() => {
|
|
15
15
|
const element = ref.current;
|
|
16
16
|
if (element && needDisable) {
|
|
17
17
|
(0, body_scroll_lock_1.disableBodyScroll)(element, options);
|
package/hooks/index.d.ts
CHANGED
|
@@ -26,4 +26,4 @@ export declare const useOutsideClick: (elementRef: React.MutableRefObject<HTMLEl
|
|
|
26
26
|
* Нужен для того чтобы не получать ошибку при использовании в SSR с NodeJS.
|
|
27
27
|
* @see {@link https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85#gistcomment-2911761}
|
|
28
28
|
*/
|
|
29
|
-
export declare const useIsomorphicLayoutEffect: typeof React.
|
|
29
|
+
export declare const useIsomorphicLayoutEffect: typeof React.useLayoutEffect;
|