Merge pull request #8 from ReactTraining/revert-7-master
Revert "Fix NumberInput when displayValue is NaN"
This commit is contained in:
commit
5ee794d02b
|
@ -31,10 +31,8 @@ class NumberTextInput extends React.Component {
|
||||||
const { value } = this.state
|
const { value } = this.state
|
||||||
const displayValue = this.props.formatNumber(value)
|
const displayValue = this.props.formatNumber(value)
|
||||||
|
|
||||||
const inputValue = isNaN(displayValue) ? 0 : displayValue
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<input {...this.props} type="text" value={inputValue} onChange={this.handleChange}/>
|
<input {...this.props} type="text" value={displayValue} onChange={this.handleChange}/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue