From 785edf4c9d77e355f4be2a48908356f78bac4c02 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Thu, 14 Mar 2019 13:31:29 -0400 Subject: [PATCH] use e.key instead of e.which --- packages/embark-ui/src/components/Communication.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/embark-ui/src/components/Communication.js b/packages/embark-ui/src/components/Communication.js index 690e85f38..a5cd99b13 100644 --- a/packages/embark-ui/src/components/Communication.js +++ b/packages/embark-ui/src/components/Communication.js @@ -38,7 +38,7 @@ class Communication extends Component { } handleEnter(e, cb) { - if (e.which === 13) { + if (e.key === 'Enter') { e.preventDefault(); cb(e); } @@ -121,9 +121,9 @@ class Communication extends Component { this.handleChange(e, 'message')} + placeholder="Message" + id="message" + onChange={e => this.handleChange(e, 'message')} onKeyPress={e => this.handleEnter(e, this.sendMessage.bind(this))}/>