@woosmap/ui 4.110.4 → 4.110.6
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
|
@@ -31,7 +31,7 @@ export default class Input extends Component {
|
|
|
31
31
|
const { onChange, value: oldValue, name, step } = this.props;
|
|
32
32
|
const { value: stateValue } = this.state;
|
|
33
33
|
const theValue = oldValue || stateValue;
|
|
34
|
-
let newValue = !Number.isNaN(theValue) ? parseFloat(theValue) + step : step;
|
|
34
|
+
let newValue = !Number.isNaN(parseFloat(theValue)) ? parseFloat(theValue) + step : step;
|
|
35
35
|
newValue = this.capValue(newValue);
|
|
36
36
|
|
|
37
37
|
if (onChange) {
|
|
@@ -45,7 +45,7 @@ export default class Input extends Component {
|
|
|
45
45
|
const { onChange, value: oldValue, name, step } = this.props;
|
|
46
46
|
const { value: stateValue } = this.state;
|
|
47
47
|
const theValue = oldValue || stateValue;
|
|
48
|
-
let newValue = !Number.isNaN(theValue) ? parseFloat(theValue) - step : 0;
|
|
48
|
+
let newValue = !Number.isNaN(parseFloat(theValue)) ? parseFloat(theValue) - step : 0;
|
|
49
49
|
newValue = this.capValue(newValue);
|
|
50
50
|
|
|
51
51
|
if (onChange) {
|
|
@@ -58,7 +58,7 @@ export default class Input extends Component {
|
|
|
58
58
|
capValue = (value) => {
|
|
59
59
|
const { type } = this.props;
|
|
60
60
|
if (type === 'number') {
|
|
61
|
-
let newValue = parseFloat(value);
|
|
61
|
+
let newValue = typeof value === 'string' ? parseFloat(value) : value;
|
|
62
62
|
const { max, min } = this.props;
|
|
63
63
|
newValue = max ? Math.min(max, newValue) : newValue;
|
|
64
64
|
newValue = min ? Math.max(min, newValue) : newValue;
|
|
@@ -94,7 +94,7 @@ const Template = (args) => {
|
|
|
94
94
|
enableTogglePassword
|
|
95
95
|
/>
|
|
96
96
|
<Input placeholder="Type search" type="search" label="Search" />
|
|
97
|
-
<Input placeholder="Number input" type="number" label="Number" />
|
|
97
|
+
<Input placeholder="Number input" type="number" label="Number" step={0.1} min={0} />
|
|
98
98
|
<Input placeholder="Color input" type="color" label="Color" />
|
|
99
99
|
</div>
|
|
100
100
|
);
|