From 63904f39ee254c9014df2c158bdae39d41d8cf74 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 10 Jul 2020 16:40:02 +0200 Subject: cursors --- frontend/common/slider.component.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'frontend/common') diff --git a/frontend/common/slider.component.js b/frontend/common/slider.component.js index 7e42b4d..9d96b1e 100644 --- a/frontend/common/slider.component.js +++ b/frontend/common/slider.component.js @@ -13,6 +13,7 @@ export default class Slider extends Component { this.timeout = 0 this.handleInput = this.handleInput.bind(this) this.handleRange = this.handleRange.bind(this) + this.handleKeyDown = this.handleKeyDown.bind(this) this.onChange = throttle(props.onChange, SLIDER_THROTTLE_TIME) } componentDidMount() { @@ -48,9 +49,12 @@ export default class Slider extends Component { } if (this.state.value !== new_value) { this.setState({ value: new_value }) - this.props.onChange(new_value) + this.props.onChange(this.props.name, new_value) } } + handleKeyDown(e) { + console.log(e.keyCode) + } handleRange(e){ let { value: new_value } = e.target if (this.props.type === 'int') { @@ -98,6 +102,7 @@ export default class Slider extends Component { max={max} step={step} value={text_value} + onKeyDown={this.handleKeyDown} onChange={this.handleInput} onBlur={this.handleInput} /> -- cgit v1.2.3-70-g09d2