From b4b205232a5b50a8048c2bd22a803bc3df5859e9 Mon Sep 17 00:00:00 2001 From: Mykhailo Lapchynskyi Date: Tue, 24 Sep 2024 15:28:31 +0200 Subject: [PATCH] small fixes --- src/components/TodoFilter/TodoFilter.tsx | 6 +++++- src/components/TodoList/TodoList.tsx | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/TodoFilter/TodoFilter.tsx b/src/components/TodoFilter/TodoFilter.tsx index 4fbf31281..9a9ca8c0a 100644 --- a/src/components/TodoFilter/TodoFilter.tsx +++ b/src/components/TodoFilter/TodoFilter.tsx @@ -16,6 +16,10 @@ export const TodoFilter: React.FC = () => { dispatch(setQuery(value.target.value)); }; + const resetQuery = () => { + dispatch(setQuery('')); + }; + return (

@@ -48,7 +52,7 @@ export const TodoFilter: React.FC = () => { data-cy="clearSearchButton" type="button" className="delete" - onClick={() => dispatch(setQuery(''))} + onClick={resetQuery} /> )} diff --git a/src/components/TodoList/TodoList.tsx b/src/components/TodoList/TodoList.tsx index 89e6be47f..7931ae90d 100644 --- a/src/components/TodoList/TodoList.tsx +++ b/src/components/TodoList/TodoList.tsx @@ -69,6 +69,7 @@ export const TodoList: React.FC = () => { {visibleTodos.map(todo => (