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
No known key found for this signature in database
GPG Key ID: 34A99C03E9455EB8
1 changed files with
2 additions and
2 deletions
-
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} |
|
|
|