From 0726a494be8232c616a7baea654f82be5ae574b9 Mon Sep 17 00:00:00 2001 From: orangemug Date: Sun, 19 Jan 2020 11:41:37 +0000 Subject: [PATCH] Only set dirtyValue on valid change. --- src/components/inputs/NumberInput.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/inputs/NumberInput.jsx b/src/components/inputs/NumberInput.jsx index b474c3c..093eacd 100644 --- a/src/components/inputs/NumberInput.jsx +++ b/src/components/inputs/NumberInput.jsx @@ -48,10 +48,13 @@ class NumberInput extends React.Component { const hasChanged = this.props.value !== value; if(this.isValid(value) && hasChanged) { this.props.onChange(value) + this.setState({ + dirtyValue: newValue, + }); } + this.setState({ value: newValue, - dirtyValue: newValue, }) }