@chakra-ui/focus-lock
Advanced tools
Comparing version 1.0.0-next.4 to 1.0.0-next.5
@@ -6,2 +6,14 @@ # Change Log | ||
# [1.0.0-next.5](https://github.com/chakra-ui/chakra-ui/compare/@chakra-ui/focus-lock@1.0.0-next.4...@chakra-ui/focus-lock@1.0.0-next.5) (2020-07-15) | ||
### Features | ||
- add transition for modal | ||
([dda931b](https://github.com/chakra-ui/chakra-ui/commit/dda931bea7444c3f83392eebf1c34dd571a0dbbc)) | ||
# Change Log | ||
All notable changes to this project will be documented in this file. See | ||
[Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
# 1.0.0-next.4 (2020-07-01) | ||
@@ -8,0 +20,0 @@ |
@@ -32,4 +32,4 @@ "use strict"; | ||
isDisabled = props.isDisabled, | ||
_props$autoFocus = props.autoFocus, | ||
autoFocus = _props$autoFocus === void 0 ? true : _props$autoFocus; | ||
autoFocus = props.autoFocus, | ||
persistentFocus = props.persistentFocus; | ||
var onActivation = React.useCallback(function () { | ||
@@ -43,3 +43,3 @@ if (initialFocusRef == null ? void 0 : initialFocusRef.current) { | ||
if (focusables.length === 0) { | ||
contentRef.current.focus(); | ||
(0, _utils.focus)(contentRef.current); | ||
} | ||
@@ -56,2 +56,3 @@ } | ||
return /*#__PURE__*/React.createElement(_reactFocusLock["default"], { | ||
persistentFocus: persistentFocus, | ||
autoFocus: autoFocus, | ||
@@ -58,0 +59,0 @@ disabled: isDisabled, |
import * as React from "react"; | ||
import ReactFocusLock from "react-focus-lock"; | ||
import { __DEV__, getAllFocusable } from "@chakra-ui/utils"; | ||
import { __DEV__, getAllFocusable, focus } from "@chakra-ui/utils"; | ||
@@ -19,3 +19,4 @@ /** | ||
isDisabled, | ||
autoFocus = true | ||
autoFocus, | ||
persistentFocus | ||
} = props; | ||
@@ -30,3 +31,3 @@ var onActivation = React.useCallback(() => { | ||
if (focusables.length === 0) { | ||
contentRef.current.focus(); | ||
focus(contentRef.current); | ||
} | ||
@@ -43,2 +44,3 @@ } | ||
return /*#__PURE__*/React.createElement(ReactFocusLock, { | ||
persistentFocus: persistentFocus, | ||
autoFocus: autoFocus, | ||
@@ -45,0 +47,0 @@ disabled: isDisabled, |
@@ -34,2 +34,7 @@ import * as React from "react"; | ||
autoFocus?: boolean; | ||
/** | ||
* If `true`, disables text selections inside, and outside focus lock. | ||
* @default `false` | ||
*/ | ||
persistentFocus?: boolean; | ||
} | ||
@@ -36,0 +41,0 @@ /** |
{ | ||
"name": "@chakra-ui/focus-lock", | ||
"version": "1.0.0-next.4", | ||
"version": "1.0.0-next.5", | ||
"description": "React focus lock for all Chakra components", | ||
@@ -49,3 +49,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@chakra-ui/utils": "^1.0.0-next.4", | ||
"@chakra-ui/utils": "^1.0.0-next.5", | ||
"react-focus-lock": "2.3.1" | ||
@@ -56,3 +56,3 @@ }, | ||
}, | ||
"gitHead": "cdd5eac1db90ba33a07c009fb8dbcc4453d6ec01" | ||
"gitHead": "24eec5d796d81b6fafbcfa7231fb2cb15e6d5a29" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
22386
249