mirror of
https://github.com/maputnik/editor.git
synced 2025-12-28 17:10:01 +00:00
Rename to mapital
This commit is contained in:
@@ -12,7 +12,8 @@ static propTypes = {
|
||||
}
|
||||
|
||||
onChange(e) {
|
||||
return this.props.onChange(e.target.value)
|
||||
const value = e.target.value
|
||||
return this.props.onChange(value === "" ? null: value)
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -22,7 +23,7 @@ static propTypes = {
|
||||
style={inputStyle.input}
|
||||
name={this.props.name}
|
||||
placeholder={this.props.default}
|
||||
value={this.props.value}
|
||||
value={this.props.value ? this.props.value : ""}
|
||||
onChange={this.onChange.bind(this)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,12 @@ class NumberField extends React.Component {
|
||||
}
|
||||
|
||||
onChange(e) {
|
||||
return this.props.onChange(parseFloat(e.target.value))
|
||||
const value = parseFloat(e.target.value)
|
||||
/*TODO: we can do range validation already here?
|
||||
if(this.props.min && value < this.props.min) return
|
||||
if(this.props.max && value > this.props.max) return
|
||||
*/
|
||||
this.props.onChange(value)
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
@@ -12,7 +12,8 @@ static propTypes = {
|
||||
}
|
||||
|
||||
onChange(e) {
|
||||
return this.props.onChange(e.target.value)
|
||||
const value = e.target.value
|
||||
return this.props.onChange(value === "" ? null: value)
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
Reference in New Issue
Block a user