rc-input-number
Advanced tools
Comparing version 7.0.0-alpha.2 to 7.0.0-alpha.3
@@ -8,3 +8,3 @@ import * as React from 'react'; | ||
var initRef = React.useRef(false); | ||
React.useEffect(function () { | ||
React.useLayoutEffect(function () { | ||
if (!initRef.current) { | ||
@@ -11,0 +11,0 @@ initRef.current = true; |
@@ -252,3 +252,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
setUncontrolledDecimalValue(updateValue); | ||
onChange === null || onChange === void 0 ? void 0 : onChange(getDecimalValue(stringMode, updateValue)); // Reformat input if value is not controlled | ||
onChange === null || onChange === void 0 ? void 0 : onChange(updateValue.isEmpty() ? null : getDecimalValue(stringMode, updateValue)); // Reformat input if value is not controlled | ||
@@ -344,7 +344,5 @@ if (value === undefined) { | ||
if (!parsedValue.isNaN()) { | ||
// Only validate value can be re-fill to inputValue | ||
if (!formatValue.isEmpty()) { | ||
// Reassign the formatValue within ranged of trigger control | ||
formatValue = triggerValueUpdate(parsedValue, true); | ||
} | ||
// Only validate value or empty value can be re-fill to inputValue | ||
// Reassign the formatValue within ranged of trigger control | ||
formatValue = triggerValueUpdate(parsedValue, true); | ||
} else { | ||
@@ -351,0 +349,0 @@ formatValue = decimalValue; |
@@ -17,3 +17,3 @@ "use strict"; | ||
var initRef = React.useRef(false); | ||
React.useEffect(function () { | ||
React.useLayoutEffect(function () { | ||
if (!initRef.current) { | ||
@@ -20,0 +20,0 @@ initRef.current = true; |
@@ -275,3 +275,3 @@ "use strict"; | ||
setUncontrolledDecimalValue(updateValue); | ||
onChange === null || onChange === void 0 ? void 0 : onChange(getDecimalValue(stringMode, updateValue)); // Reformat input if value is not controlled | ||
onChange === null || onChange === void 0 ? void 0 : onChange(updateValue.isEmpty() ? null : getDecimalValue(stringMode, updateValue)); // Reformat input if value is not controlled | ||
@@ -367,7 +367,5 @@ if (value === undefined) { | ||
if (!parsedValue.isNaN()) { | ||
// Only validate value can be re-fill to inputValue | ||
if (!formatValue.isEmpty()) { | ||
// Reassign the formatValue within ranged of trigger control | ||
formatValue = triggerValueUpdate(parsedValue, true); | ||
} | ||
// Only validate value or empty value can be re-fill to inputValue | ||
// Reassign the formatValue within ranged of trigger control | ||
formatValue = triggerValueUpdate(parsedValue, true); | ||
} else { | ||
@@ -374,0 +372,0 @@ formatValue = decimalValue; |
{ | ||
"name": "rc-input-number", | ||
"version": "7.0.0-alpha.2", | ||
"version": "7.0.0-alpha.3", | ||
"description": "React input-number component", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
91588
2151