@chakra-ui/editable
Advanced tools
Comparing version 2.0.10 to 2.0.11
@@ -61,2 +61,3 @@ "use strict"; | ||
var import_react_use_merge_refs = require("@chakra-ui/react-use-merge-refs"); | ||
var import_react_use_callback_ref = require("@chakra-ui/react-use-callback-ref"); | ||
var import_shared_utils = require("@chakra-ui/shared-utils"); | ||
@@ -82,5 +83,6 @@ var import_react2 = require("react"); | ||
placeholder, | ||
onEdit: onEditProp, | ||
onEdit: onEditCallback, | ||
...htmlProps | ||
} = props; | ||
const onEditProp = (0, import_react_use_callback_ref.useCallbackRef)(onEditCallback); | ||
const defaultIsEditing = Boolean(startWithEditView && !isDisabled); | ||
@@ -120,4 +122,5 @@ const [isEditing, setIsEditing] = (0, import_react2.useState)(defaultIsEditing); | ||
(_b = inputRef.current) == null ? void 0 : _b.focus(); | ||
if (selectAllOnFocus) | ||
if (selectAllOnFocus) { | ||
(_c = inputRef.current) == null ? void 0 : _c.select(); | ||
} | ||
onEditProp == null ? void 0 : onEditProp(); | ||
@@ -124,0 +127,0 @@ }, [isEditing, onEditProp, selectAllOnFocus]); |
@@ -30,2 +30,3 @@ // ../../../react-shim.js | ||
import { mergeRefs } from "@chakra-ui/react-use-merge-refs"; | ||
import { useCallbackRef } from "@chakra-ui/react-use-callback-ref"; | ||
import { ariaAttr, callAllHandlers } from "@chakra-ui/shared-utils"; | ||
@@ -51,5 +52,6 @@ import { useCallback, useRef, useState } from "react"; | ||
placeholder, | ||
onEdit: onEditProp, | ||
onEdit: onEditCallback, | ||
...htmlProps | ||
} = props; | ||
const onEditProp = useCallbackRef(onEditCallback); | ||
const defaultIsEditing = Boolean(startWithEditView && !isDisabled); | ||
@@ -89,4 +91,5 @@ const [isEditing, setIsEditing] = useState(defaultIsEditing); | ||
(_b = inputRef.current) == null ? void 0 : _b.focus(); | ||
if (selectAllOnFocus) | ||
if (selectAllOnFocus) { | ||
(_c = inputRef.current) == null ? void 0 : _c.select(); | ||
} | ||
onEditProp == null ? void 0 : onEditProp(); | ||
@@ -93,0 +96,0 @@ }, [isEditing, onEditProp, selectAllOnFocus]); |
{ | ||
"name": "@chakra-ui/editable", | ||
"version": "2.0.10", | ||
"version": "2.0.11", | ||
"description": "React component used to build inline-editable components", | ||
@@ -43,2 +43,3 @@ "keywords": [ | ||
"@chakra-ui/react-use-focus-on-pointer-down": "2.0.2", | ||
"@chakra-ui/react-use-callback-ref": "2.0.3", | ||
"@chakra-ui/react-context": "2.0.3", | ||
@@ -49,3 +50,3 @@ "@chakra-ui/react-types": "2.0.3", | ||
"devDependencies": { | ||
"@chakra-ui/system": "2.2.10", | ||
"@chakra-ui/system": "2.2.11", | ||
"@chakra-ui/layout": "2.1.7", | ||
@@ -52,0 +53,0 @@ "react": "^18.0.0" |
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
36134
946
11