enter login & navigate all menu
This commit is contained in:
@ -69,6 +69,12 @@ const Login = () => {
|
||||
setShowPassword(!showPassword);
|
||||
};
|
||||
|
||||
const handleKeyPress = (e: { key: string }) => {
|
||||
if (e.key === 'Enter') {
|
||||
formik.handleSubmit();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="card max-w-[390px] w-full">
|
||||
<form
|
||||
@ -90,6 +96,7 @@ const Login = () => {
|
||||
className={clsx('form-control', {
|
||||
'is-invalid': formik.touched.username && formik.errors.username
|
||||
})}
|
||||
onKeyPress={handleKeyPress}
|
||||
/>
|
||||
</label>
|
||||
{formik.touched.username && formik.errors.username && (
|
||||
@ -112,6 +119,7 @@ const Login = () => {
|
||||
className={clsx('form-control', {
|
||||
'is-invalid': formik.touched.password && formik.errors.password
|
||||
})}
|
||||
onKeyPress={handleKeyPress}
|
||||
/>
|
||||
<button className="btn btn-icon" onClick={togglePassword}>
|
||||
<KeenIcon icon="eye" className={clsx('text-gray-500', { hidden: showPassword })} />
|
||||
|
||||
Reference in New Issue
Block a user