From 952651c6858b40f425c5efad86fcdb7558ab70d0 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Tue, 30 May 2017 13:02:35 +0100 Subject: [PATCH 1/2] Allow pressing Enter to submit setMxId --- src/components/views/dialogs/SetMxIdDialog.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/views/dialogs/SetMxIdDialog.js b/src/components/views/dialogs/SetMxIdDialog.js index 19924093de..61acbf2192 100644 --- a/src/components/views/dialogs/SetMxIdDialog.js +++ b/src/components/views/dialogs/SetMxIdDialog.js @@ -91,6 +91,12 @@ export default React.createClass({ }); }, + onKeyUp: function(ev) { + if (ev.keyCode === 13) { + this.onSubmit(); + } + }, + onSubmit: function(ev) { this.setState({ doingUIAuth: true, @@ -233,7 +239,10 @@ export default React.createClass({
{ usernameBusyIndicator } From 47bf5401fa06cc074bb6818b7b5c98c11c8de54a Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Tue, 30 May 2017 13:14:14 +0100 Subject: [PATCH 2/2] Use KeyCode.ENTER instead of 13 --- src/components/views/dialogs/SetMxIdDialog.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/views/dialogs/SetMxIdDialog.js b/src/components/views/dialogs/SetMxIdDialog.js index 61acbf2192..efca192ec1 100644 --- a/src/components/views/dialogs/SetMxIdDialog.js +++ b/src/components/views/dialogs/SetMxIdDialog.js @@ -20,6 +20,7 @@ import React from 'react'; import sdk from '../../../index'; import MatrixClientPeg from '../../../MatrixClientPeg'; import classnames from 'classnames'; +import KeyCode from '../../../KeyCode'; // The amount of time to wait for further changes to the input username before // sending a request to the server @@ -92,7 +93,7 @@ export default React.createClass({ }, onKeyUp: function(ev) { - if (ev.keyCode === 13) { + if (ev.keyCode === KeyCode.ENTER) { this.onSubmit(); } },