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
parent
commit
47db21b04b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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