Skip to content

Commit

Permalink
latest update
Browse files Browse the repository at this point in the history
  • Loading branch information
VikaChereushenko committed Dec 12, 2024
1 parent 5278154 commit cc7c529
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/TodoItem/TodoItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ export const TodoItem: React.FC<Props> = ({
const inputRef = useRef<HTMLInputElement>(null);

useEffect(() => {
if (inputRef.current) {
if (isTitleBeingUpdated && inputRef.current) {
inputRef.current.focus();
}
}, [isTitleBeingUpdated]);
});

return (
<div data-cy="Todo" className={classNames('todo', { completed })}>
Expand Down

0 comments on commit cc7c529

Please sign in to comment.