@vertigis/react-ui 20.0.1 → 20.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -94,7 +94,7 @@ const NumberInput = forwardRef(({ onChange, onBlur, value, defaultValue, max, mi
|
|
|
94
94
|
newValue = +newValue.toFixed(maxDecimals);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
return newValue;
|
|
97
|
+
return newValue ?? NaN;
|
|
98
98
|
}, [max, min, maxDecimalPlaces]);
|
|
99
99
|
useEffect(() => {
|
|
100
100
|
if (value === undefined) {
|
|
@@ -136,6 +136,9 @@ const NumberInput = forwardRef(({ onChange, onBlur, value, defaultValue, max, mi
|
|
|
136
136
|
});
|
|
137
137
|
export default NumberInput;
|
|
138
138
|
function getDecimalPlaces(value) {
|
|
139
|
+
if (isNaN(value)) {
|
|
140
|
+
return 0;
|
|
141
|
+
}
|
|
139
142
|
const text = value.toString();
|
|
140
143
|
if (text.includes("e-")) {
|
|
141
144
|
const [, exponent] = text.split("e-");
|