From c6e1374b578581be32596f88146ff6cd948dfa3b Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 20 Jun 2018 18:24:49 +0200 Subject: send recordings to results page --- app/client/common/textInput.component.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'app/client/common/textInput.component.js') diff --git a/app/client/common/textInput.component.js b/app/client/common/textInput.component.js index 1e2ca01..a3739d4 100644 --- a/app/client/common/textInput.component.js +++ b/app/client/common/textInput.component.js @@ -3,14 +3,23 @@ import { h, Component } from 'preact' class TextInput extends Component { constructor(props){ super(props) + this.state = { value: null, changed: false } this.handleInput = this.handleInput.bind(this) this.handleKeydown = this.handleKeydown.bind(this) } handleInput(e){ + this.setState({ + value: e.target.value, + changed: true, + }) this.props.onInput && this.props.onInput(e.target.value) } handleKeydown(e){ if (e.keyCode === 13) { + this.setState({ + value: e.target.value, + changed: false, + }) this.props.onSave && this.props.onSave(e.target.value) } } @@ -21,7 +30,7 @@ class TextInput extends Component { {this.props.title}