mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-11-10 09:47:46 +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) {
|
||||
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)
|
||||
}
|
||||
|
||||
|
@ -209,7 +214,7 @@ export default class FunctionSpecProperty extends React.Component {
|
|||
fieldName={this.props.fieldName}
|
||||
fieldSpec={this.props.fieldSpec}
|
||||
value={this.props.value.default}
|
||||
onChange={propVal => this.changeDataProperty("default", propVal)}
|
||||
onChange={(_, propVal) => this.changeDataProperty("default", propVal)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue