From 37707c422aa838723999263b0d8572c08b05eff8 Mon Sep 17 00:00:00 2001 From: Afrie Irham Date: Wed, 5 Jul 2023 18:40:48 +0800 Subject: [PATCH] fix: allow user to press Enter in login page --- frontend/src/components/login/InitialLoginStep.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/login/InitialLoginStep.tsx b/frontend/src/components/login/InitialLoginStep.tsx index bcce19d1c..72e375482 100644 --- a/frontend/src/components/login/InitialLoginStep.tsx +++ b/frontend/src/components/login/InitialLoginStep.tsx @@ -1,4 +1,4 @@ -import { useState } from "react"; +import { FormEvent, useState } from "react"; import { useTranslation } from "react-i18next"; import Link from "next/link"; import { useRouter } from "next/router"; @@ -31,7 +31,8 @@ export default function InitialLoginStep({ const [isLoading, setIsLoading] = useState(false); const [loginError, setLoginError] = useState(false); - const handleLogin = async () => { + const handleLogin = async (e: FormEvent) => { + e.preventDefault() try { if (!email || !password) { return; @@ -98,7 +99,7 @@ export default function InitialLoginStep({ setIsLoading(false); } - return
+ return

Login to Infisical

{/*
-
+ }