Browse Source

Refuse to pass the change event if there's no value selected to avoid crash from issue-1457

master
Juan Cortes Ross 7 years ago
parent
commit
d801e64ba8
No known key found for this signature in database GPG Key ID: 34A99C03E9455EB8
  1. 4
      src/components/base/InputCurrency/index.js

4
src/components/base/InputCurrency/index.js

@ -172,7 +172,7 @@ class InputCurrency extends PureComponent<Props, State> {
renderListUnits = () => {
const { units, onChangeUnit, unit } = this.props
const { isFocused } = this.state
const avoidEmptyValue = value => value && onChangeUnit(value)
if (units.length <= 1) {
return null
}
@ -180,7 +180,7 @@ class InputCurrency extends PureComponent<Props, State> {
return (
<Currencies onClick={stopPropagation}>
<Select
onChange={onChangeUnit}
onChange={avoidEmptyValue}
options={units}
value={unit}
getOptionValue={unitGetOptionValue}

Loading…
Cancel
Save