1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-09 00:00:01 +01:00

fix onChange callback for widget parameters control

This commit is contained in:
Steffen Vogel 2018-11-21 14:47:23 +02:00
parent 0226fca305
commit 8934a8e5a3

View file

@ -37,11 +37,20 @@ class EditWidgetParametersControl extends Component {
this.setState({ widget: nextProps.widget });
}
handleChange(value) {
this.props.handleChange({
target: {
id: this.props.controlId,
value: value
}
});
}
render() {
return (
<FormGroup controlId={this.props.controlId} validationState={this.props.validate ? this.props.validate(this.props.controlId) : null}>
<ControlLabel>{this.props.label}</ControlLabel>
<ParametersEditor content={this.state.widget[this.props.controlId] || {}} onChange={e => this.props.handleChange(e)} />
<ParametersEditor content={this.state.widget[this.props.controlId] || {}} onChange={(v)=> this.handleChange(v)} />
</FormGroup>
);
}