Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <InputGroup size="sm">
- <Input name="input1" type="number" onKeyPress={this.onKeyPress.bind(this)} value={this.state.point1}
- onChange={(e) => this.setInputValue(e, 'point1')}
- onBlur={() => this.setSliderValueFromInput('point1')} />
- </InputGroup>
- <InputGroup size="sm" >
- <Input name="input2" type="number" onKeyPress={this.onKeyPress.bind(this)} value={this.state.point2}
- onChange={(e) => this.setInputValue(e, 'point2')}
- onBlur={() => this.setSliderValueFromInput('point2')} />
- </InputGroup>
- onKeyPress(event) {
- const keyCode = event.keyCode || event.which;
- const keyValue = String.fromCharCode(keyCode);
- if (/+|-/.test(keyValue))
- event.preventDefault();
- }
- <InputGroup size="sm" >
- <Input
- name="input2"
- type="number"
- value={this.state.point2}
- style={
- this.state.point2 < 1.2 || this.state.point2 > 3.2 ?
- {border: '1px solid red'} :
- {}
- }
- onKeyPress={this.onKeyPress.bind(this)}
- onChange={(e) => this.setInputValue(e, 'point2')}
- onBlur={() => this.setSliderValueFromInput('point2')} />
- </InputGroup>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement