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

Commit

Permalink
press enter login
Browse files Browse the repository at this point in the history
  • Loading branch information
trazyn committed Sep 26, 2017
1 parent 73ea711 commit aa752b9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/js/pages/Login/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ class Login extends Component {
});
}

async handleEnter(e) {
if (e.charCode !== 13) {
return;
}

this.doLogin();
}

render() {
var { classes, logining } = this.props;

Expand Down Expand Up @@ -74,6 +82,7 @@ class Login extends Component {
ref="phone"
type="text" />
<input
onKeyPress={e => this.handleEnter(e)}
placeholder="Password"
ref="password"
type="password" />
Expand Down

0 comments on commit aa752b9

Please sign in to comment.