Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mykhailo Lapchynskyi authored and Mykhailo Lapchynskyi committed Sep 24, 2024
1 parent f1e3aaf commit b4b2052
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/TodoFilter/TodoFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ export const TodoFilter: React.FC = () => {
dispatch(setQuery(value.target.value));
};

const resetQuery = () => {
dispatch(setQuery(''));
};

return (
<form className="field has-addons">
<p className="control">
Expand Down Expand Up @@ -48,7 +52,7 @@ export const TodoFilter: React.FC = () => {
data-cy="clearSearchButton"
type="button"
className="delete"
onClick={() => dispatch(setQuery(''))}
onClick={resetQuery}
/>
</span>
)}
Expand Down
1 change: 1 addition & 0 deletions src/components/TodoList/TodoList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const TodoList: React.FC = () => {
<tbody>
{visibleTodos.map(todo => (
<tr
key={todo.id}
data-cy="todo"
className={classNames('', {
'has-background-info-light': todo.id === currentTodo?.id,
Expand Down

0 comments on commit b4b2052

Please sign in to comment.