From f9288e22a0f33e1000cbf872e25030c43b1f611e Mon Sep 17 00:00:00 2001 From: moon Date: Mon, 14 Oct 2024 00:21:09 -0700 Subject: [PATCH] clear input on send --- src/main.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.tsx b/src/main.tsx index 211ef76..ca22268 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -265,8 +265,9 @@ const App = () => { const handleSubmit = useCallback( async (e: React.FormEvent) => { e.preventDefault() - await processInput(inputText) + const input = inputText.trim() setInputText('') + await processInput(input) }, [inputText, processInput] )