Skip to content

Commit

Permalink
fix final ver
Browse files Browse the repository at this point in the history
  • Loading branch information
VvynnykV committed Nov 5, 2024
1 parent d9162cd commit 07de3f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,17 @@ export const Header: FC = () => {
);
};

const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
const handleSubmit = (
event: // eslint-disable-next-line @typescript-eslint/indent
React.FormEvent<HTMLFormElement> | React.FocusEvent<HTMLInputElement>,
) => {
event.preventDefault();

const newTitle = title.trim();

if (!newTitle) {
setTitle('');

return;
}

Expand Down Expand Up @@ -72,6 +77,7 @@ export const Header: FC = () => {
value={title}
onChange={event => setTitle(event.target.value)}
disabled={isSubmitting}
onBlur={handleSubmit}
/>
</form>
</header>
Expand Down
2 changes: 0 additions & 2 deletions src/components/TodoItem/TodoItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ export const TodoItem: React.FC<Props> = ({ todo }) => {
return;
}

setEditedTitle(validEditedTitle);

try {
dispatch({
type: 'update',
Expand Down

0 comments on commit 07de3f8

Please sign in to comment.