diff --git a/src/widget/edit-widget/edit-widget-color-control.js b/src/widget/edit-widget/edit-widget-color-control.js index c031597..2158a55 100644 --- a/src/widget/edit-widget/edit-widget-color-control.js +++ b/src/widget/edit-widget/edit-widget-color-control.js @@ -75,7 +75,16 @@ class EditWidgetColorControl extends Component { 'checked': idx === (isCustomProperty ? this.state.widget[parts[0]][parts[1]] : this.state.widget[this.props.controlId]) }); - return ( this.props.handleChange({target: { id: this.props.controlId, value: idx}})} />) + return ( this.props.handleChange({target: { id: this.props.controlId, value: idx}})} />) } ) } diff --git a/src/widget/edit-widget/edit-widget-control-creator.js b/src/widget/edit-widget/edit-widget-control-creator.js index 1b2f996..2b656dc 100644 --- a/src/widget/edit-widget/edit-widget-control-creator.js +++ b/src/widget/edit-widget/edit-widget-control-creator.js @@ -122,7 +122,7 @@ export default function CreateControls(widgetType = null, widget = null, session DialogControls.push( handleChange(e)} />, handleChange(e)} />, - handleChange(e)} /> + handleChange(e)} /> ); break; case 'Label': diff --git a/src/widget/edit-widget/edit-widget-number-control.js b/src/widget/edit-widget/edit-widget-number-control.js index 5354863..3b3101f 100644 --- a/src/widget/edit-widget/edit-widget-number-control.js +++ b/src/widget/edit-widget/edit-widget-number-control.js @@ -25,25 +25,36 @@ class EditWidgetNumberControl extends Component { this.state = { widget: { customProperties:{} - } + } }; } - + static getDerivedStateFromProps(props, state){ return{ - widget: props.widget + widget: props.widget }; - } + } render() { let step = 1; if(this.props.controlId ==='customProperties.background_color_opacity'){ step = 0.1; - } + } + + let parts = this.props.controlId.split('.'); + let isCustomProperty = true; + if (parts.length === 1){ + isCustomProperty = false; + } + return ( {this.props.label} - this.props.handleChange(e)} /> + this.props.handleChange(e)} /> ); }