From 2a08abaa955a9e60a06584ef7203e07743d70928 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 19 Jan 2017 16:35:40 +0000 Subject: [PATCH] Keep old behaviour of submitting on enter if input is empty --- src/components/views/dialogs/ChatInviteDialog.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/views/dialogs/ChatInviteDialog.js b/src/components/views/dialogs/ChatInviteDialog.js index 767620d93f..c117944482 100644 --- a/src/components/views/dialogs/ChatInviteDialog.js +++ b/src/components/views/dialogs/ChatInviteDialog.js @@ -135,7 +135,10 @@ module.exports = React.createClass({ } else if (e.keyCode === 13) { // enter e.stopPropagation(); e.preventDefault(); - if (this.state.queryList.length > 0) { + if (this.refs.textinput.value == '') { + // if there's nothing in the input box, submit the form + this.onButtonClick(); + } else if (this.state.queryList.length > 0) { this.addressSelector.chooseSelection(); } else { const addrType = Invite.getAddressType(this.refs.textinput.value);