commit
2374879234
|
@ -14,7 +14,7 @@ let isCurrencyPrefixed = language =>
|
|||
|
||||
class CurrencyInput extends Component {
|
||||
state = {
|
||||
value: this.props.defaultValue
|
||||
value: this.props.storeValue
|
||||
}
|
||||
onChange = this.props.debounce
|
||||
? debounce(this.props.debounce, this.props.onChange)
|
||||
|
@ -39,6 +39,14 @@ class CurrencyInput extends Component {
|
|||
}
|
||||
this.onChange(event)
|
||||
}
|
||||
componentDidUpdate(prevProps) {
|
||||
if (
|
||||
prevProps.storeValue !== this.props.storeValue &&
|
||||
this.props.storeValue !== this.state.value
|
||||
) {
|
||||
this.setState({ value: this.props.storeValue })
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
let forwardedProps = omit(
|
||||
|
|
|
@ -28,7 +28,7 @@ export default compose(
|
|||
withColours,
|
||||
reduxForm({
|
||||
form: 'conversation',
|
||||
destroyOnUnmount: false
|
||||
destroyOnUnmount: true
|
||||
}),
|
||||
connect(
|
||||
state => ({
|
||||
|
@ -212,9 +212,9 @@ const Target = ({
|
|||
<Animate.fromTop>
|
||||
<InputSuggestions
|
||||
suggestions={target.suggestions}
|
||||
onFirstClick={value =>
|
||||
onFirstClick={value => {
|
||||
setFormValue(target.dottedName, '' + value)
|
||||
}
|
||||
}}
|
||||
rulePeriod={target.période}
|
||||
colouredBackground={true}
|
||||
/>
|
||||
|
@ -250,7 +250,7 @@ let CurrencyField = withColours(props => {
|
|||
}}
|
||||
debounce={600}
|
||||
className="targetInput"
|
||||
defaultValue={props.input.value}
|
||||
storeValue={props.input.value}
|
||||
{...props.input}
|
||||
{...props}
|
||||
/>
|
||||
|
|
Loading…
Reference in New Issue