mirror of
https://github.com/maputnik/editor.git
synced 2026-08-24 05:57:25 +00:00
Only set dirtyValue on valid change.
This commit is contained in:
@@ -48,10 +48,13 @@ class NumberInput extends React.Component {
|
|||||||
const hasChanged = this.props.value !== value;
|
const hasChanged = this.props.value !== value;
|
||||||
if(this.isValid(value) && hasChanged) {
|
if(this.isValid(value) && hasChanged) {
|
||||||
this.props.onChange(value)
|
this.props.onChange(value)
|
||||||
|
this.setState({
|
||||||
|
dirtyValue: newValue,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
value: newValue,
|
value: newValue,
|
||||||
dirtyValue: newValue,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user