diff --git a/apps/timo-web/api/todo/todo-schema.ts b/apps/timo-web/api/todo/todo-schema.ts index f1516663..ec98b4e4 100644 --- a/apps/timo-web/api/todo/todo-schema.ts +++ b/apps/timo-web/api/todo/todo-schema.ts @@ -42,7 +42,7 @@ export const createTodoRequestSchema = z repeatType: todoRepeatTypeSchema, repeatWeekdays: z.array(todoRepeatWeekdaySchema).nullable(), repeatDayOfMonth: z.number().int().min(1).max(31).nullable(), - memo: z.string().nullable(), + memo: z.string().max(300).nullable(), }) .superRefine((value, ctx) => { if ( 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 054b37a3..9d6120a9 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 @@ -84,11 +84,7 @@ export const HomeTodoCard = ({ const titleRow = (
onToggleSubtaskCompleted?.(checked)} - disabled={isCompleted} />
{subtaskTitle} diff --git a/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/home/_components/todo-modal/CreateTodoMemoField.tsx b/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/home/_components/todo-modal/CreateTodoMemoField.tsx index b12a565a..5f80837c 100644 --- a/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/home/_components/todo-modal/CreateTodoMemoField.tsx +++ b/apps/timo-web/app/[locale]/(main)/(with-time-sidebar)/home/_components/todo-modal/CreateTodoMemoField.tsx @@ -1,3 +1,11 @@ +const MEMO_MAX_LENGTH = 300; + +const resizeTextarea = (element: HTMLTextAreaElement | null) => { + if (!element) return; + element.style.height = "auto"; + element.style.height = `${element.scrollHeight}px`; +}; + export interface CreateTodoMemoFieldProps { value: string; placeholder: string; @@ -12,10 +20,13 @@ export const CreateTodoMemoField = ({ return (