diff --git a/apps/todo/apps/web/src/lib/components/TaskItem.svelte b/apps/todo/apps/web/src/lib/components/TaskItem.svelte index 83966bc35..61e0d4305 100644 --- a/apps/todo/apps/web/src/lib/components/TaskItem.svelte +++ b/apps/todo/apps/web/src/lib/components/TaskItem.svelte @@ -308,6 +308,32 @@ return `${completed}/${task.subtasks.length}`; }); + // Long press to expand (mobile) + let longPressTimer: ReturnType | null = null; + + function handleTouchStart() { + longPressTimer = setTimeout(() => { + longPressTimer = null; + if (!isExpanded && onExpand) { + onExpand(); + } + }, 500); + } + + function handleTouchEnd() { + if (longPressTimer) { + clearTimeout(longPressTimer); + longPressTimer = null; + } + } + + function handleTouchMove() { + if (longPressTimer) { + clearTimeout(longPressTimer); + longPressTimer = null; + } + } + // Only allow drag from the drag handle function handlePointerDown(e: PointerEvent) { const target = e.target as HTMLElement; @@ -321,7 +347,14 @@ -
+