From 8d112e1339e39dcd6da00b473554a4119aad0295 Mon Sep 17 00:00:00 2001 From: Stepan Usatiuk Date: Sun, 10 Mar 2019 15:58:58 +0300 Subject: [PATCH] submit form on enter --- frontend/src/Auth/Login.tsx | 6 ++++-- frontend/src/Auth/Signup.tsx | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/src/Auth/Login.tsx b/frontend/src/Auth/Login.tsx index a51f64e..b5a5640 100644 --- a/frontend/src/Auth/Login.tsx +++ b/frontend/src/Auth/Login.tsx @@ -36,7 +36,8 @@ export class LoginComponent extends React.PureComponent< this.props.history.push("/signup"); } - public submit() { + public submit(e: React.FormEvent) { + e.preventDefault(); const { username, password } = this.state; if (!this.props.inProgress) { this.props.login(username, password); @@ -52,7 +53,7 @@ export class LoginComponent extends React.PureComponent< return ( <> -
+

Login