From ca6510c98e77b96e0d8779c7f06d9510a34cdcca Mon Sep 17 00:00:00 2001 From: Madhura68 Date: Sat, 25 Apr 2026 19:20:37 +0200 Subject: [PATCH] fix(todos): only clear title on submit, preserve product dropdown selection Replace form.reset() with a titleRef so successful submission clears the title input while leaving the selected product unchanged. Co-Authored-By: Claude Sonnet 4.6 --- components/todos/todo-list.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/todos/todo-list.tsx b/components/todos/todo-list.tsx index 1cdfe0f..998ebac 100644 --- a/components/todos/todo-list.tsx +++ b/components/todos/todo-list.tsx @@ -42,15 +42,15 @@ interface TodoListProps { function QuickInput({ products, isDemo }: { products: Product[]; isDemo: boolean }) { const [state, formAction] = useActionState(createTodoAction, undefined) - const ref = useRef(null) + const titleRef = useRef(null) useEffect(() => { - if (state?.success) ref.current?.reset() + if (state?.success && titleRef.current) titleRef.current.value = '' }, [state]) return (
-
+