Commit c6d5ed51 authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼
Browse files

set property step of number inputs to any for allowing non-integer inputs

parent 343723cc
......@@ -49,10 +49,10 @@ class EditWidgetMinMaxControl extends React.Component {
<tbody>
<tr>
<td>
Min: <FormControl type="number" id={this.props.controlId + "Min"} disabled={!this.state.widget[this.props.controlId + "UseMinMax"]} placeholder="Minimum value" value={this.state.widget[this.props.controlId + 'Min']} onChange={e => this.props.handleChange(e)} />
Min: <FormControl type="number" step="any" id={this.props.controlId + "Min"} disabled={!this.state.widget[this.props.controlId + "UseMinMax"]} placeholder="Minimum value" value={this.state.widget[this.props.controlId + 'Min']} onChange={e => this.props.handleChange(e)} />
</td>
<td>
Max: <FormControl type="number" id={this.props.controlId + "Max"} disabled={!this.state.widget[this.props.controlId + "UseMinMax"]} placeholder="Maximum value" value={this.state.widget[this.props.controlId + 'Max']} onChange={e => this.props.handleChange(e)} />
Max: <FormControl type="number" step="any" id={this.props.controlId + "Max"} disabled={!this.state.widget[this.props.controlId + "UseMinMax"]} placeholder="Maximum value" value={this.state.widget[this.props.controlId + 'Max']} onChange={e => this.props.handleChange(e)} />
</td>
</tr>
</tbody>
......
......@@ -38,10 +38,9 @@ class EditWidgetNumberControl extends Component {
render() {
return (
<FormGroup controlId={this.props.controlId} validationState={this.props.validate ? this.props.validate(this.props.controlId) : null}>
<FormGroup controlId={this.props.controlId}>
<ControlLabel>{this.props.label}</ControlLabel>
<FormControl type="number" defaultValue={this.props.defaultValue} value={this.state.widget[this.props.controlId]} onChange={e => this.props.handleChange(e)} />
<FormControl.Feedback />
<FormControl type="number" step="any" defaultValue={this.props.defaultValue} value={this.state.widget[this.props.controlId] || 0} onChange={e => this.props.handleChange(e)} />
</FormGroup>
);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment