From 1b0ac4339f1cbbaa21faa21807721399efd34591 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 26 Jun 2020 14:57:34 +0200 Subject: [PATCH] Listen to input evbent in composer Avoids having the pending text removed when re-rendering the component. --- components/composer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/composer.js b/components/composer.js index 992c135..eacc483 100644 --- a/components/composer.js +++ b/components/composer.js @@ -9,12 +9,12 @@ export default class Composer extends Component { constructor(props) { super(props); - this.handleChange = this.handleChange.bind(this); + this.handleInput = this.handleInput.bind(this); this.handleSubmit = this.handleSubmit.bind(this); this.handleWindowKeyDown = this.handleWindowKeyDown.bind(this); } - handleChange(event) { + handleInput(event) { this.setState({ [event.target.name]: event.target.value }); } @@ -48,7 +48,7 @@ export default class Composer extends Component { render() { return html` -
+
`;