@chakra-ui/focus-lock
Advanced tools
Comparing version 0.0.0-dev-20230116122157 to 0.0.0-dev-20230116124502
@@ -37,2 +37,4 @@ "use strict"; | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var _a; | ||
var FocusTrap = (_a = import_react_focus_lock.default.default) != null ? _a : import_react_focus_lock.default; | ||
var FocusLock = (props) => { | ||
@@ -57,4 +59,4 @@ const { | ||
requestAnimationFrame(() => { | ||
var _a; | ||
(_a = contentRef.current) == null ? void 0 : _a.focus(); | ||
var _a2; | ||
(_a2 = contentRef.current) == null ? void 0 : _a2.focus(); | ||
}); | ||
@@ -65,8 +67,8 @@ } | ||
const onDeactivation = (0, import_react.useCallback)(() => { | ||
var _a; | ||
(_a = finalFocusRef == null ? void 0 : finalFocusRef.current) == null ? void 0 : _a.focus(); | ||
var _a2; | ||
(_a2 = finalFocusRef == null ? void 0 : finalFocusRef.current) == null ? void 0 : _a2.focus(); | ||
}, [finalFocusRef]); | ||
const returnFocus = restoreFocus && !finalFocusRef; | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( | ||
import_react_focus_lock.default, | ||
FocusTrap, | ||
{ | ||
@@ -73,0 +75,0 @@ crossFrame: lockFocusAcrossFrames, |
@@ -38,2 +38,4 @@ "use strict"; | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var _a; | ||
var FocusTrap = (_a = import_react_focus_lock.default.default) != null ? _a : import_react_focus_lock.default; | ||
var FocusLock = (props) => { | ||
@@ -58,4 +60,4 @@ const { | ||
requestAnimationFrame(() => { | ||
var _a; | ||
(_a = contentRef.current) == null ? void 0 : _a.focus(); | ||
var _a2; | ||
(_a2 = contentRef.current) == null ? void 0 : _a2.focus(); | ||
}); | ||
@@ -66,8 +68,8 @@ } | ||
const onDeactivation = (0, import_react.useCallback)(() => { | ||
var _a; | ||
(_a = finalFocusRef == null ? void 0 : finalFocusRef.current) == null ? void 0 : _a.focus(); | ||
var _a2; | ||
(_a2 = finalFocusRef == null ? void 0 : finalFocusRef.current) == null ? void 0 : _a2.focus(); | ||
}, [finalFocusRef]); | ||
const returnFocus = restoreFocus && !finalFocusRef; | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( | ||
import_react_focus_lock.default, | ||
FocusTrap, | ||
{ | ||
@@ -74,0 +76,0 @@ crossFrame: lockFocusAcrossFrames, |
{ | ||
"name": "@chakra-ui/focus-lock", | ||
"version": "0.0.0-dev-20230116122157", | ||
"version": "0.0.0-dev-20230116124502", | ||
"description": "React focus lock for all Chakra components", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12472
303