Browse Source
Merge pull request #1459 from juan-cortes/issue-1457
Cancel empty onChange events for InputCurrency components
master
Meriadec Pillet
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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} |
|
|
|