@acusti/input-text
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -14,2 +14,3 @@ import * as React from 'react'; | ||
const handleBlur = useCallback((event) => { | ||
inputRef.current = event.currentTarget; | ||
if (onBlur) | ||
@@ -36,3 +37,5 @@ onBlur(event); | ||
// but it doesn’t work in Safari, so we use the initial onSelect event instead | ||
const handleSelect = useCallback(() => { | ||
const handleSelect = useCallback((event) => { | ||
const input = event.currentTarget; | ||
inputRef.current = input; | ||
// Do nothing if this isn’t the initial select-on-focus event | ||
@@ -43,5 +46,4 @@ if (!isInitialSelectionRef.current) | ||
isInitialSelectionRef.current = false; | ||
const input = inputRef.current; | ||
// Do nothing if input has no value | ||
if (!input || !input.value) | ||
if (!input.value) | ||
return; | ||
@@ -48,0 +50,0 @@ // Do nothing if input is no longer the document’s activeElement |
{ | ||
"name": "@acusti/input-text", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "React component that renders a semi-controlled input with multiLine and selectTextOnFocus support", | ||
@@ -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
17538
259