mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-01-30 16:25:31 +01:00
Fix default field bug
This commit is contained in:
parent
4af7a71220
commit
b4292028c2
1 changed files with 7 additions and 2 deletions
|
@ -121,7 +121,12 @@ export default class FunctionSpecProperty extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
changeDataProperty(propName, propVal) {
|
changeDataProperty(propName, propVal) {
|
||||||
this.props.value[propName] = propVal
|
if (propVal) {
|
||||||
|
this.props.value[propName] = propVal
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
delete this.props.value[propName]
|
||||||
|
}
|
||||||
this.props.onChange(this.props.fieldName, this.props.value)
|
this.props.onChange(this.props.fieldName, this.props.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,7 +214,7 @@ export default class FunctionSpecProperty extends React.Component {
|
||||||
fieldName={this.props.fieldName}
|
fieldName={this.props.fieldName}
|
||||||
fieldSpec={this.props.fieldSpec}
|
fieldSpec={this.props.fieldSpec}
|
||||||
value={this.props.value.default}
|
value={this.props.value.default}
|
||||||
onChange={propVal => this.changeDataProperty("default", propVal)}
|
onChange={(_, propVal) => this.changeDataProperty("default", propVal)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue