From 062e2e915ba4b0420b52b99a8e681996f09ef2bf Mon Sep 17 00:00:00 2001 From: Matri Date: Mon, 21 Aug 2023 21:26:32 +0800 Subject: [PATCH] fix: login improvement (#941) --- web/app/components/base/button/index.tsx | 3 +++ web/app/signin/normalForm.tsx | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/web/app/components/base/button/index.tsx b/web/app/components/base/button/index.tsx index cbf1533eb..f28f9b478 100644 --- a/web/app/components/base/button/index.tsx +++ b/web/app/components/base/button/index.tsx @@ -7,6 +7,7 @@ export type IButtonProps = { className?: string disabled?: boolean loading?: boolean + tabIndex?: number children: React.ReactNode onClick?: MouseEventHandler } @@ -18,6 +19,7 @@ const Button: FC = ({ className, onClick, loading = false, + tabIndex, }) => { let style = 'cursor-pointer' switch (type) { @@ -35,6 +37,7 @@ const Button: FC = ({ return (
{children} diff --git a/web/app/signin/normalForm.tsx b/web/app/signin/normalForm.tsx index d28c7c0ce..efb3de783 100644 --- a/web/app/signin/normalForm.tsx +++ b/web/app/signin/normalForm.tsx @@ -237,6 +237,10 @@ const NormalForm = () => { id="password" value={password} onChange={e => setPassword(e.target.value)} + onKeyDown={(e) => { + if (e.key === 'Enter') + handleEmailPasswordLogin() + }} type={showPassword ? 'text' : 'password'} autoComplete="current-password" placeholder={t('login.passwordPlaceholder') || ''} @@ -256,6 +260,7 @@ const NormalForm = () => {