diff --git a/app/src/routes/Auth.tsx b/app/src/routes/Auth.tsx index 4953c5b..fd193fd 100644 --- a/app/src/routes/Auth.tsx +++ b/app/src/routes/Auth.tsx @@ -141,6 +141,16 @@ function Login() { } }; + useEffect(() => { + // listen to enter key and auto submit + const listener = async (e: KeyboardEvent) => { + if (e.key === "Enter") await onSubmit(); + }; + + document.addEventListener("keydown", listener); + return () => document.removeEventListener("keydown", listener); + }, []); + return (