@onehat/ui 0.3.160 → 0.3.162
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.
package/package.json
CHANGED
|
@@ -56,13 +56,11 @@ function NumberElement(props) {
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
onChangeText = (value) => {
|
|
59
|
-
if (value.match(/\.$/)) { // if value ends with a decimal point
|
|
60
|
-
setLocalValue(value);
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
59
|
|
|
64
60
|
if (value === '') {
|
|
65
61
|
value = null; // empty string makes value null
|
|
62
|
+
} else if (value.match(/\.$/)) { // value ends with a decimal point
|
|
63
|
+
// don't parseFloat, otherwise we'll lose the decimal point
|
|
66
64
|
} else {
|
|
67
65
|
value = parseFloat(value, 10);
|
|
68
66
|
}
|