Skip to content
Snippets Groups Projects
Commit 75db0b57 authored by Philipp Memmel's avatar Philipp Memmel
Browse files

Hitting Enter sends waiting room message

parent 6d50d7cd
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,13 @@ class TextInput extends PureComponent {
this.setState({ message });
}
handleOnKeyDown(e) {
if (e.keyCode === 13 && e.shiftKey === false) {
e.preventDefault();
this.handleOnClick();
}
}
handleOnClick() {
const { send } = this.props;
const { message } = this.state;
......@@ -58,6 +65,7 @@ class TextInput extends PureComponent {
className={styles.textarea}
maxLength={maxLength}
onChange={(e) => this.handleOnChange(e)}
onKeyDown={(e) => this.handleOnKeyDown(e)}
placeholder={placeholder}
value={message}
/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment