From 1c7526548e9d35eacd07711c2e7aaa07a342ee8d Mon Sep 17 00:00:00 2001 From: awlfccamp Date: Sun, 18 May 2025 15:00:09 -0500 Subject: [PATCH 1/2] enable enter key submission on login --- client/src/components/auth/Auth.jsx | 47 +++++++++++++++-------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/client/src/components/auth/Auth.jsx b/client/src/components/auth/Auth.jsx index 8d0f1d103..d0b7b22ac 100644 --- a/client/src/components/auth/Auth.jsx +++ b/client/src/components/auth/Auth.jsx @@ -3,13 +3,7 @@ import { Redirect } from 'react-router-dom'; import { useHistory } from 'react-router-dom'; import { checkUser, checkAuth } from '../../services/user.service'; import { authLevelRedirect } from '../../utils/authUtils'; -import { - Typography, - Button, - FormControl, - Box, - TextField -} from '@mui/material'; +import { Typography, Button, FormControl, Box, TextField } from '@mui/material'; import useAuth from '../../hooks/useAuth'; import '../../sass/AdminLogin.scss'; @@ -107,7 +101,9 @@ const Auth = () => {
- Welcome Back! + + Welcome Back! +
{ >
- - - - + + + { + if (e.key === 'Enter') { + handleLogin(e); + } + }} + aria-label="Email Address" + data-test="input-email" + autoComplete="email" + /> +
@@ -149,7 +150,7 @@ const Auth = () => { className="login-button" data-test="login-btn" disabled={isDisabled} - sx={{color: 'black'}} + sx={{ color: 'black' }} > LOGIN From bb893cd13517692073b5770da6a0d06b0b1f3cf2 Mon Sep 17 00:00:00 2001 From: awlfccamp Date: Mon, 19 May 2025 22:05:00 -0500 Subject: [PATCH 2/2] wrap FormControl with form --- client/src/components/auth/Auth.jsx | 45 ++++++++++++++--------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/client/src/components/auth/Auth.jsx b/client/src/components/auth/Auth.jsx index d0b7b22ac..e5fa196fe 100644 --- a/client/src/components/auth/Auth.jsx +++ b/client/src/components/auth/Auth.jsx @@ -105,36 +105,33 @@ const Auth = () => { Welcome Back!
- -
-
- - - { - if (e.key === 'Enter') { - handleLogin(e); - } - }} - aria-label="Email Address" - data-test="input-email" - autoComplete="email" - /> + +
+
+ + + + - +
-
- + +