summaryrefslogtreecommitdiff
path: root/frontend/common/slider.component.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-07-10 16:40:02 +0200
committerJules Laplace <julescarbon@gmail.com>2020-07-10 16:40:02 +0200
commit63904f39ee254c9014df2c158bdae39d41d8cf74 (patch)
tree4c5822f9774d9afd45225055239de4e3cc879ee3 /frontend/common/slider.component.js
parent9f017f8524b9ef687aaaa57a2775f86e5391a7cf (diff)
cursors
Diffstat (limited to 'frontend/common/slider.component.js')
-rw-r--r--frontend/common/slider.component.js7
1 files changed, 6 insertions, 1 deletions
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}
/>