From 44b8c29c849a9feb46876adacb6c61710527d723 Mon Sep 17 00:00:00 2001 From: wmwragg Date: Mon, 12 Sep 2016 17:06:43 +0100 Subject: [PATCH] Allow addresses to be added as text when space or comma are pressed --- src/components/views/dialogs/ChatInviteDialog.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/views/dialogs/ChatInviteDialog.js b/src/components/views/dialogs/ChatInviteDialog.js index a88b27ba02..ce7a0c26d5 100644 --- a/src/components/views/dialogs/ChatInviteDialog.js +++ b/src/components/views/dialogs/ChatInviteDialog.js @@ -74,8 +74,6 @@ module.exports = React.createClass({ // Either an address tile was created, or text input is being used if (this.state.inviteList[0]) { addr = this.state.inviteList[0]; - } else { - addr = this.refs.textinput.value; } // Check if the addr is a valid type @@ -121,6 +119,15 @@ module.exports = React.createClass({ e.stopPropagation(); e.preventDefault(); this.addressSelector.onKeyReturn(); + } else if (e.keyCode === 32 || e.keyCode === 188) { // space or comma + e.stopPropagation(); + e.preventDefault(); + var inviteList = this.state.inviteList.slice(); + inviteList.push(this.refs.textinput.value); + this.setState({ + inviteList: inviteList, + queryList: [], + }); } },