@adamjanicki/ui 1.5.3 → 1.5.4
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,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
type
|
|
2
|
+
type Props = {
|
|
3
3
|
/**
|
|
4
4
|
* Callback that fires when the user clicks outside the layer
|
|
5
5
|
*/
|
|
@@ -27,6 +27,11 @@ type LayerProps = {
|
|
|
27
27
|
* @default false
|
|
28
28
|
*/
|
|
29
29
|
returnFocusOnEscape?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* [Optional] disable the scroll lock behavior of the layer
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
disableScrollLock?: boolean;
|
|
30
35
|
};
|
|
31
|
-
declare const Layer: ({ returnFocusOnEscape, ...props }:
|
|
36
|
+
declare const Layer: ({ returnFocusOnEscape, disableScrollLock, ...props }: Props) => JSX.Element;
|
|
32
37
|
export default Layer;
|
|
@@ -50,9 +50,9 @@ var BaseLayer = function (_a) {
|
|
|
50
50
|
}) }));
|
|
51
51
|
};
|
|
52
52
|
var Layer = function (_a) {
|
|
53
|
-
var
|
|
53
|
+
var returnFocusOnEscape = _a.returnFocusOnEscape, disableScrollLock = _a.disableScrollLock, props = __rest(_a, ["returnFocusOnEscape", "disableScrollLock"]);
|
|
54
54
|
// Lock and unlock on mount and unmount
|
|
55
|
-
useScrollLock();
|
|
55
|
+
useScrollLock(!disableScrollLock);
|
|
56
56
|
useEffect(function () {
|
|
57
57
|
return function () {
|
|
58
58
|
var _a;
|