mirror of
https://github.com/maputnik/editor.git
synced 2026-11-27 12:33:43 +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:
1 parent
07523c00f0
commit
fab004cdfe
1 file changed
+1
-1
@@ -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