Allow pressing Enter to submit setMxId

pull/21833/head
Luke Barnard 2017-05-30 13:02:35 +01:00
parent 9536e1ef36
commit 952651c685
1 changed files with 10 additions and 1 deletions

View File

@ -91,6 +91,12 @@ export default React.createClass({
}); });
}, },
onKeyUp: function(ev) {
if (ev.keyCode === 13) {
this.onSubmit();
}
},
onSubmit: function(ev) { onSubmit: function(ev) {
this.setState({ this.setState({
doingUIAuth: true, doingUIAuth: true,
@ -233,7 +239,10 @@ export default React.createClass({
<div className="mx_Dialog_content"> <div className="mx_Dialog_content">
<div className="mx_SetMxIdDialog_input_group"> <div className="mx_SetMxIdDialog_input_group">
<input type="text" ref="input_value" value={this.state.username} <input type="text" ref="input_value" value={this.state.username}
autoFocus={true} onChange={this.onValueChange} size="30" autoFocus={true}
onChange={this.onValueChange}
onKeyUp={this.onKeyUp}
size="30"
className={inputClasses} className={inputClasses}
/> />
{ usernameBusyIndicator } { usernameBusyIndicator }