Allow addresses to be added as text when space or comma are pressed

This commit is contained in:
wmwragg 2016-09-12 17:06:43 +01:00
parent 5b2cc555a3
commit 44b8c29c84

View file

@ -74,8 +74,6 @@ module.exports = React.createClass({
// Either an address tile was created, or text input is being used // Either an address tile was created, or text input is being used
if (this.state.inviteList[0]) { if (this.state.inviteList[0]) {
addr = this.state.inviteList[0]; addr = this.state.inviteList[0];
} else {
addr = this.refs.textinput.value;
} }
// Check if the addr is a valid type // Check if the addr is a valid type
@ -121,6 +119,15 @@ module.exports = React.createClass({
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
this.addressSelector.onKeyReturn(); 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: [],
});
} }
}, },