diff --git a/src/components/DeploymentLogs.tsx b/src/components/DeploymentLogs.tsx index f7e093f..6e2100a 100644 --- a/src/components/DeploymentLogs.tsx +++ b/src/components/DeploymentLogs.tsx @@ -51,10 +51,10 @@ export function DeploymentLogs({ deploymentUuid, status, initialLogs }: Deployme } }, [initialLogs, fetchLogs]); - // Auto-scroll to bottom when new logs arrive + // Auto-scroll to bottom when new logs arrive (within container only) useEffect(() => { - if (autoScroll && logsEndRef.current) { - logsEndRef.current.scrollIntoView({ behavior: 'smooth' }); + if (autoScroll && containerRef.current) { + containerRef.current.scrollTop = containerRef.current.scrollHeight; } }, [logs, autoScroll]); @@ -141,7 +141,9 @@ export function DeploymentLogs({ deploymentUuid, status, initialLogs }: Deployme onClick={(e) => { e.stopPropagation(); setAutoScroll(true); - logsEndRef.current?.scrollIntoView({ behavior: 'smooth' }); + if (containerRef.current) { + containerRef.current.scrollTop = containerRef.current.scrollHeight; + } }} className="absolute bottom-4 right-4 px-3 py-1.5 bg-slate-200 dark:bg-stone-800 text-slate-700 dark:text-stone-300 text-xs rounded-full shadow-lg hover:bg-slate-300 dark:hover:bg-stone-700 transition-colors" >