# HG changeset patch # User Alexandre Segura # Date 1498492224 -7200 # Node ID 2c2a9c8dc2161a86706df003fbc38c20ec914b0f # Parent 469da13402e25cb8e0ed0d5f259853e609e086e4 Submit form on enter. diff -r 469da13402e2 -r 2c2a9c8dc216 client/src/components/Login.js --- a/client/src/components/Login.js Mon Jun 26 17:40:28 2017 +0200 +++ b/client/src/components/Login.js Mon Jun 26 17:50:24 2017 +0200 @@ -15,6 +15,12 @@ this.props.authActions.loginSubmit(username, password); } + submit = (e) => { + e.preventDefault(); + + this.login(); + } + onClickRegister = (e) => { e.preventDefault(); this.props.history.push('/register'); @@ -56,7 +62,7 @@ -
+ Username { this.username = ref; }} /> @@ -68,7 +74,7 @@ { this.renderErrorMessage(errorMessages, 'password') } { this.renderNonFieldErrors(errorMessages) } - +

diff -r 469da13402e2 -r 2c2a9c8dc216 client/src/components/Register.js --- a/client/src/components/Register.js Mon Jun 26 17:40:28 2017 +0200 +++ b/client/src/components/Register.js Mon Jun 26 17:50:24 2017 +0200 @@ -17,6 +17,12 @@ this.props.authActions.registerSubmit(username, email, password1, password2); } + submit = (e) => { + e.preventDefault(); + + this.register(); + } + onClickLogin = (e) => { e.preventDefault(); this.props.history.push('/login'); @@ -45,7 +51,7 @@ -

+ Username { this.username = ref; }} /> @@ -66,7 +72,7 @@ { this.password2 = ref; }} /> { this.renderErrorMessage(errorMessages, 'password2') } - +