Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Give our input fields names #520

Merged
merged 1 commit into from
Oct 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/components/structures/login/ForgotPassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,19 @@ module.exports = React.createClass({
<div>
<form onSubmit={this.onSubmitForm}>
<input className="mx_Login_field" ref="user" type="text"
name="reset_email" // define a name so browser's password autofill gets less confused
value={this.state.email}
onChange={this.onInputChanged.bind(this, "email")}
placeholder="Email address" autoFocus />
<br />
<input className="mx_Login_field" ref="pass" type="password"
name="reset_password"
value={this.state.password}
onChange={this.onInputChanged.bind(this, "password")}
placeholder="New password" />
<br />
<input className="mx_Login_field" ref="pass" type="password"
name="reset_password_confirm"
value={this.state.password2}
onChange={this.onInputChanged.bind(this, "password2")}
placeholder="Confirm your new password" />
Expand Down
2 changes: 2 additions & 0 deletions src/components/views/login/PasswordLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,12 @@ module.exports = React.createClass({displayName: 'PasswordLogin',
<div>
<form onSubmit={this.onSubmitForm}>
<input className="mx_Login_field" type="text"
name="username" // make it a little easier for browser's remember-password
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note this will mean anyone why's already told chrome to remember their passwords will have to re-enter their credentials. We could remove this if we're not happy with that: I figure it's better to have them and if so we'd better do it sooner rather than later.

value={this.state.username} onChange={this.onUsernameChanged}
placeholder="Email or user name" autoFocus />
<br />
<input className={pwFieldClass} ref={(e) => {this._passwordField = e;}} type="password"
name="password"
value={this.state.password} onChange={this.onPasswordChanged}
placeholder="Password" />
<br />
Expand Down