Skip to content

Commit

Permalink
solution
Browse files Browse the repository at this point in the history
  • Loading branch information
JulyaPetrovskaya committed Oct 25, 2023
1 parent 1b6a6a1 commit 10d88fd
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/components/TodoItem/TodoItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const TodoItem: React.FC<Props> = ({ todo, isLoading }) => {
inputField.current.focus();
}
}, [isEditing]);
// если isEditing равно true. Если isEditing
// если isEditing равно true. Если isEditing
// становится false, то фокус не будет устанавливаться.

const handleDoubleClick = () => {
Expand Down Expand Up @@ -73,8 +73,7 @@ export const TodoItem: React.FC<Props> = ({ todo, isLoading }) => {
}
};


return (
return (
<div
data-cy="Todo"
key={id}
Expand All @@ -92,14 +91,14 @@ export const TodoItem: React.FC<Props> = ({ todo, isLoading }) => {
onChange={() => !isLoading && toggleTodo(todo)}
/>
</label>

{!isEditing ? (
<>
<span
data-cy="TodoTitle"
data-cy="TodoTitle"
className="todo__title"
onDoubleClick={handleDoubleClick}
>
>
{ title }
</span>

Expand All @@ -112,7 +111,7 @@ export const TodoItem: React.FC<Props> = ({ todo, isLoading }) => {
×
</button>
</>
): (
) : (
<form onSubmit={handleEditSubmit} onBlur={handleEditCancel}>
<input
data-cy="TodoTitleField"
Expand Down

0 comments on commit 10d88fd

Please sign in to comment.