Make NumberInput more tolerant to errors

This commit is contained in:
Lukas Martinelli
2016-12-30 16:18:53 +01:00
parent 89d497c73f
commit 1d7768e37c
2 changed files with 55 additions and 22 deletions

View File

@@ -31,7 +31,7 @@ export default class PropertyGroup extends React.Component {
onPropertyChange(property, newValue) {
const group = getGroupName(this.props.layer.type, property)
this.props.onChange(group , property ,newValue)
this.props.onChange(group , property, newValue)
}
render() {
@@ -40,7 +40,7 @@ export default class PropertyGroup extends React.Component {
const paint = this.props.layer.paint || {}
const layout = this.props.layer.layout || {}
const fieldValue = paint[fieldName] || layout[fieldName]
const fieldValue = fieldName in paint ? paint[fieldName] : layout[fieldName]
return <ZoomSpecField
onChange={this.onPropertyChange.bind(this)}