From da85df9d1a9667ba7ba42f94a1728daf9e9e52ea Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 17 Sep 2016 15:21:08 +0100 Subject: [PATCH] let comma trigger autocomplete. hook up backspace. search displaynames that include space --- src/components/views/dialogs/ChatInviteDialog.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/views/dialogs/ChatInviteDialog.js b/src/components/views/dialogs/ChatInviteDialog.js index afc6a2f825..c2ad8883d4 100644 --- a/src/components/views/dialogs/ChatInviteDialog.js +++ b/src/components/views/dialogs/ChatInviteDialog.js @@ -124,15 +124,19 @@ module.exports = React.createClass({ e.stopPropagation(); e.preventDefault(); this.addressSelector.onKeyDown(); - } else if (this.state.queryList.length > 0 && (e.keyCode === 13 || e.keyCode === 9)) { // enter or tab + } else if (this.state.queryList.length > 0 && (e.keyCode === 188, e.keyCode === 13 || e.keyCode === 9)) { // comma or enter or tab e.stopPropagation(); e.preventDefault(); this.addressSelector.onKeySelect(); + } else if (this.refs.textinput.value.length === 0 && this.state.inviteList.length && e.keyCode === 8) { // backspace + e.stopPropagation(); + e.preventDefault(); + this.onDismissed(this.state.inviteList.length - 1)(); } else if (e.keyCode === 13) { // enter e.stopPropagation(); e.preventDefault(); this.onButtonClick(); - } else if (e.keyCode === 32 || e.keyCode === 188 || e.keyCode === 9) { // space, comma or tab + } else if (e.keyCode === 188 || e.keyCode === 9) { // comma or tab e.stopPropagation(); e.preventDefault(); var check = Invite.isValidAddress(this.refs.textinput.value);