diff --git a/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/home/_components/todo-card/HomeTodoCard.tsx b/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/home/_components/todo-card/HomeTodoCard.tsx index fad902ee..81ab97a3 100644 --- a/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/home/_components/todo-card/HomeTodoCard.tsx +++ b/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/home/_components/todo-card/HomeTodoCard.tsx @@ -28,8 +28,7 @@ import type { KeyboardEvent, MouseEvent, PointerEvent } from "react"; import { convertDurationToTimeText } from "@/utils/todo/todo-time"; const isInteractiveElement = (target: EventTarget | null) => - target instanceof HTMLElement && - Boolean(target.closest("button, input, label")); + target instanceof Element && Boolean(target.closest("button, input, label")); export interface HomeTodoCardProps { todoId: number; diff --git a/apps/timo-web/hooks/todo-modal/detail/use-detail-subtask-field.ts b/apps/timo-web/hooks/todo-modal/detail/use-detail-subtask-field.ts index 67f93c12..f4e6d1a1 100644 --- a/apps/timo-web/hooks/todo-modal/detail/use-detail-subtask-field.ts +++ b/apps/timo-web/hooks/todo-modal/detail/use-detail-subtask-field.ts @@ -40,6 +40,20 @@ export const useDetailSubtaskField = ({ const inputRefs = useRef>([]); const pendingFocusIndex = useRef(null); + useEffect(() => { + setSubtaskInputs((prev) => + prev.map((input) => { + const serverSubtask = subtasks.find( + (subtask) => subtask.subtaskId === input.subtaskId, + ); + if (!serverSubtask || serverSubtask.completed === input.completed) { + return input; + } + return { ...input, completed: serverSubtask.completed }; + }), + ); + }, [subtasks]); + useEffect(() => { if (pendingFocusIndex.current === null) return;