diff --git a/src/components/views/auth/RegistrationForm.js b/src/components/views/auth/RegistrationForm.js
index 91f8e1b226..8ca454dabd 100644
--- a/src/components/views/auth/RegistrationForm.js
+++ b/src/components/views/auth/RegistrationForm.js
@@ -486,6 +486,7 @@ export default createReactClass({
id="mx_RegistrationForm_password"
ref={field => this[FIELD_PASSWORD] = field}
type="password"
+ autoComplete="new-password"
label={_t("Password")}
value={this.state.password}
onChange={this.onPasswordChange}
@@ -499,6 +500,7 @@ export default createReactClass({
id="mx_RegistrationForm_passwordConfirm"
ref={field => this[FIELD_PASSWORD_CONFIRM] = field}
type="password"
+ autoComplete="new-password"
label={_t("Confirm")}
value={this.state.passwordConfirm}
onChange={this.onPasswordConfirmChange}
diff --git a/src/components/views/dialogs/DeactivateAccountDialog.js b/src/components/views/dialogs/DeactivateAccountDialog.js
index 7e36232eb0..d7468933df 100644
--- a/src/components/views/dialogs/DeactivateAccountDialog.js
+++ b/src/components/views/dialogs/DeactivateAccountDialog.js
@@ -118,6 +118,7 @@ export default class DeactivateAccountDialog extends React.Component {
const Field = sdk.getComponent('elements.Field');
+ // this is on purpose not a to prevent Enter triggering submission, to further prevent accidents
return (
{
+ if (!this.state.recoveryKeyValid) return;
+
this.setState({
loading: true,
restoreError: null,
@@ -157,18 +158,6 @@ export default class RestoreKeyBackupDialog extends React.PureComponent {
});
}
- _onPassPhraseKeyPress = (e) => {
- if (e.key === Key.ENTER) {
- this._onPassPhraseNext();
- }
- }
-
- _onRecoveryKeyKeyPress = (e) => {
- if (e.key === Key.ENTER && this.state.recoveryKeyValid) {
- this._onRecoveryKeyNext();
- }
- }
-
async _restoreWithSecretStorage() {
this.setState({
loading: true,
@@ -305,21 +294,22 @@ export default class RestoreKeyBackupDialog extends React.PureComponent {
"messaging by entering your recovery passphrase.",
)}
-
+
+
{_t(
"If you've forgotten your recovery passphrase you can "+
"use your recovery key or " +
@@ -371,7 +361,6 @@ export default class RestoreKeyBackupDialog extends React.PureComponent {
diff --git a/src/components/views/dialogs/secretstorage/AccessSecretStorageDialog.js b/src/components/views/dialogs/secretstorage/AccessSecretStorageDialog.js
index 08d9f8dd5e..68ae8281c4 100644
--- a/src/components/views/dialogs/secretstorage/AccessSecretStorageDialog.js
+++ b/src/components/views/dialogs/secretstorage/AccessSecretStorageDialog.js
@@ -1,6 +1,6 @@
/*
Copyright 2018, 2019 New Vector Ltd
-Copyright 2019 The Matrix.org Foundation C.I.C.
+Copyright 2019, 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -21,7 +21,6 @@ import * as sdk from '../../../../index';
import {MatrixClientPeg} from '../../../../MatrixClientPeg';
import { _t } from '../../../../languageHandler';
-import { Key } from "../../../../Keyboard";
/*
* Access Secure Secret Storage by requesting the user's passphrase.
@@ -68,7 +67,11 @@ export default class AccessSecretStorageDialog extends React.PureComponent {
});
}
- _onPassPhraseNext = async () => {
+ _onPassPhraseNext = async (e) => {
+ e.preventDefault();
+
+ if (this.state.passPhrase.length <= 0) return;
+
this.setState({ keyMatches: null });
const input = { passphrase: this.state.passPhrase };
const keyMatches = await this.props.checkPrivateKey(input);
@@ -79,7 +82,11 @@ export default class AccessSecretStorageDialog extends React.PureComponent {
}
}
- _onRecoveryKeyNext = async () => {
+ _onRecoveryKeyNext = async (e) => {
+ e.preventDefault();
+
+ if (!this.state.recoveryKeyValid) return;
+
this.setState({ keyMatches: null });
const input = { recoveryKey: this.state.recoveryKey };
const keyMatches = await this.props.checkPrivateKey(input);
@@ -97,18 +104,6 @@ export default class AccessSecretStorageDialog extends React.PureComponent {
});
}
- _onPassPhraseKeyPress = (e) => {
- if (e.key === Key.ENTER && this.state.passPhrase.length > 0) {
- this._onPassPhraseNext();
- }
- }
-
- _onRecoveryKeyKeyPress = (e) => {
- if (e.key === Key.ENTER && this.state.recoveryKeyValid) {
- this._onRecoveryKeyNext();
- }
- }
-
render() {
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
@@ -135,7 +130,7 @@ export default class AccessSecretStorageDialog extends React.PureComponent {
)}
@@ -149,23 +144,25 @@ export default class AccessSecretStorageDialog extends React.PureComponent {
"identity for verifying other sessions by entering your passphrase.",
)}
-
-
+
{keyStatus}
-
-
+
{_t(
"If you've forgotten your passphrase you can "+
"use your recovery key or " +
@@ -192,7 +189,7 @@ export default class AccessSecretStorageDialog extends React.PureComponent {
let keyStatus;
if (this.state.recoveryKey.length === 0) {
- keyStatus = ;
+ keyStatus = ;
} else if (this.state.recoveryKeyValid) {
keyStatus =
{"\uD83D\uDC4D "}{_t("This looks like a valid recovery key!")}
@@ -221,22 +218,22 @@ export default class AccessSecretStorageDialog extends React.PureComponent {
"identity for verifying other sessions by entering your recovery key.",
)}
-
+
+
{_t(
"If you've forgotten your recovery key you can "+
"."
diff --git a/src/components/views/settings/ChangePassword.js b/src/components/views/settings/ChangePassword.js
index 291313a463..3ba276d1fa 100644
--- a/src/components/views/settings/ChangePassword.js
+++ b/src/components/views/settings/ChangePassword.js
@@ -253,20 +253,24 @@ export default createReactClass({