Fix page scroll on row expand - use container scrollTop instead of scrollIntoView
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user