Prevent default for forgot password link
The forgot password link should prevent default to avoid changing the URL's hash state.
This commit is contained in:
parent
d220dd49ef
commit
42bb3c4f40
1 changed files with 8 additions and 1 deletions
|
@ -58,6 +58,7 @@ class PasswordLogin extends React.Component {
|
||||||
loginType: PasswordLogin.LOGIN_FIELD_MXID,
|
loginType: PasswordLogin.LOGIN_FIELD_MXID,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.onForgotPasswordClick = this.onForgotPasswordClick.bind(this);
|
||||||
this.onSubmitForm = this.onSubmitForm.bind(this);
|
this.onSubmitForm = this.onSubmitForm.bind(this);
|
||||||
this.onUsernameChanged = this.onUsernameChanged.bind(this);
|
this.onUsernameChanged = this.onUsernameChanged.bind(this);
|
||||||
this.onUsernameBlur = this.onUsernameBlur.bind(this);
|
this.onUsernameBlur = this.onUsernameBlur.bind(this);
|
||||||
|
@ -74,6 +75,12 @@ class PasswordLogin extends React.Component {
|
||||||
this._loginField = null;
|
this._loginField = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onForgotPasswordClick(ev) {
|
||||||
|
ev.preventDefault();
|
||||||
|
ev.stopPropagation();
|
||||||
|
this.props.onForgotPasswordClick();
|
||||||
|
}
|
||||||
|
|
||||||
onSubmitForm(ev) {
|
onSubmitForm(ev) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
|
|
||||||
|
@ -244,7 +251,7 @@ class PasswordLogin extends React.Component {
|
||||||
forgotPasswordJsx = <span>
|
forgotPasswordJsx = <span>
|
||||||
{_t('Not sure of your password? <a>Set a new one</a>', {}, {
|
{_t('Not sure of your password? <a>Set a new one</a>', {}, {
|
||||||
a: sub => <a className="mx_Login_forgot"
|
a: sub => <a className="mx_Login_forgot"
|
||||||
onClick={this.props.onForgotPasswordClick}
|
onClick={this.onForgotPasswordClick}
|
||||||
href="#"
|
href="#"
|
||||||
>
|
>
|
||||||
{sub}
|
{sub}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue