From a624909819ebef32b94901d8e5018b2614a1269e Mon Sep 17 00:00:00 2001 From: orangemug Date: Mon, 6 Apr 2020 10:40:30 +0100 Subject: [PATCH] Reset dirtyValue on resetValue --- src/components/inputs/NumberInput.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/inputs/NumberInput.jsx b/src/components/inputs/NumberInput.jsx index 79b3aee..b46fe6b 100644 --- a/src/components/inputs/NumberInput.jsx +++ b/src/components/inputs/NumberInput.jsx @@ -92,11 +92,13 @@ class NumberInput extends React.Component { } // If set value is invalid fall back to the last valid value from props or at last resort the default value - if(!this.isValid(this.state.value)) { + if (!this.isValid(this.state.value)) { if(this.isValid(this.props.value)) { this.changeValue(this.props.value) + this.setState({dirtyValue: this.props.value}); } else { this.changeValue(undefined); + this.setState({dirtyValue: undefined}); } } }