mirror of
https://github.com/maputnik/editor.git
synced 2025-12-24 15:10:01 +00: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:
@@ -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)
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user