Skip to content

Commit 21f7117

Browse files
committed
fix(Amount Selectors): parse value to number in onChange function
affects: @crave/farmblocks-amount-selectors ISSUES CLOSED: #397
1 parent 62f06f8 commit 21f7117

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/amount-selectors/src/components/AmountSelectors.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ class AmountSelectors extends React.Component {
4343
? event.target.validationMessage
4444
: "";
4545

46-
this.setState({ value, disableBoth, tooltipText }, cb);
47-
return this.props.onChange(value);
46+
const validValue = parseFloat(value) || 0;
47+
48+
this.setState({ value: validValue, disableBoth, tooltipText }, cb);
49+
return this.props.onChange(validValue);
4850
};
4951

5052
updateDisplayValue = () => {

0 commit comments

Comments
 (0)