From f9ccb97641a5976b20f4bb6341cb3b9e8e519515 Mon Sep 17 00:00:00 2001 From: Venkata Sai Date: Sat, 7 Sep 2024 18:08:59 +0530 Subject: [PATCH] feat: add handleKeyDown function to trigger handleNextStep on Enter key press. --- src/pages/SignUpCallback.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pages/SignUpCallback.tsx b/src/pages/SignUpCallback.tsx index 5d0517b..8e8f08a 100644 --- a/src/pages/SignUpCallback.tsx +++ b/src/pages/SignUpCallback.tsx @@ -54,6 +54,10 @@ export default function SignUpCallback() { } }; + const handleKeyDown = (e: React.KeyboardEvent) => { + if(e.key === 'Enter') handleNextStep(); + }; + const handleVerify = async () => { if (chessComId && token) { try { @@ -115,6 +119,7 @@ export default function SignUpCallback() { type="text" value={chessComId} onChange={(e) => setChessComId(e.target.value)} + onKeyDown={handleKeyDown} placeholder="Your Chess.com ID" className="w-full px-4 py-2 rounded-lg bg-white/10 border border-neon-green/30 text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-neon-green" />