mirror of
https://github.com/maputnik/editor.git
synced 2025-12-26 16:10:01 +00:00
Remove undefined root properties.
This commit is contained in:
@@ -59,9 +59,15 @@ class SettingsModal extends React.Component {
|
||||
changeStyleProperty(property, value) {
|
||||
const changedStyle = {
|
||||
...this.props.mapStyle,
|
||||
[property]: value
|
||||
};
|
||||
|
||||
if (value === undefined) {
|
||||
delete changedStyle[property];
|
||||
}
|
||||
this.props.onStyleChanged(changedStyle)
|
||||
else {
|
||||
changedStyle[property] = value;
|
||||
}
|
||||
this.props.onStyleChanged(changedStyle);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
Reference in New Issue
Block a user