mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 16:21:16 +01:00
Only set dirtyValue on valid change.
This commit is contained in:
parent
926969b921
commit
0726a494be
1 changed files with 4 additions and 1 deletions
|
@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue