mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 18:11:21 +01:00
StringInput fires change if state and props values do not match
Now it is also possible to call onChange listener if new value is empty string
This commit is contained in:
parent
07523c00f0
commit
fab004cdfe
1 changed files with 1 additions and 1 deletions
|
@ -27,7 +27,7 @@ class StringInput extends React.Component {
|
|||
placeholder={this.props.default}
|
||||
onChange={e => this.setState({ value: e.target.value })}
|
||||
onBlur={() => {
|
||||
if(this.state.value) this.props.onChange(this.state.value)
|
||||
if(this.state.value!==this.props.value) this.props.onChange(this.state.value)
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue