mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-18 14:44:58 +08:00
Keep old behaviour of submitting on enter
if input is empty
This commit is contained in:
parent
d8bcc1f067
commit
2a08abaa95
@ -135,7 +135,10 @@ module.exports = React.createClass({
|
|||||||
} else if (e.keyCode === 13) { // enter
|
} else if (e.keyCode === 13) { // enter
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
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();
|
this.addressSelector.chooseSelection();
|
||||||
} else {
|
} else {
|
||||||
const addrType = Invite.getAddressType(this.refs.textinput.value);
|
const addrType = Invite.getAddressType(this.refs.textinput.value);
|
||||||
|
Loading…
Reference in New Issue
Block a user