mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 17:56:01 +03:00
Allow addresses to be added as text when space or comma are pressed
This commit is contained in:
parent
5b2cc555a3
commit
44b8c29c84
1 changed files with 9 additions and 2 deletions
|
@ -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: [],
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue