From 19bc646d7ebf7c409453a330dfe7a4e65d97406e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Przy=C5=82uski?= Date: Thu, 10 Oct 2024 09:22:50 +0200 Subject: [PATCH] feat: toggle todo checkbox if click while renaming --- src/components/TodoItem/TodoItem.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/TodoItem/TodoItem.tsx b/src/components/TodoItem/TodoItem.tsx index 9ce748f3a..58d0b8f1f 100644 --- a/src/components/TodoItem/TodoItem.tsx +++ b/src/components/TodoItem/TodoItem.tsx @@ -36,7 +36,9 @@ export const TodoItem = ({ todo: { id, title, completed } }: Props) => { const handleOnBlur = useCallback( (event: React.FormEvent) => { - handleSubmit(event); + setTimeout(() => { + handleSubmit(event); + }, 0); }, [handleSubmit], );