From c48313ad91262e6e6998fbd1022909aab9502434 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 28 Mar 2026 14:40:31 +0100 Subject: [PATCH] fix: prevent page scroll when transcript updates Scroll only within transcript container, not the entire page. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/components/configurator/VoiceAgent.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/configurator/VoiceAgent.tsx b/src/components/configurator/VoiceAgent.tsx index 88fe364..f4c8a3b 100644 --- a/src/components/configurator/VoiceAgent.tsx +++ b/src/components/configurator/VoiceAgent.tsx @@ -64,9 +64,12 @@ export default function VoiceAgent({ locale, onComplete }: VoiceAgentProps) { const transcriptEndRef = useRef(null); - // Auto-scroll transcript + // Auto-scroll transcript within its container only useEffect(() => { - transcriptEndRef.current?.scrollIntoView({ behavior: 'smooth' }); + const el = transcriptEndRef.current; + if (el?.parentElement) { + el.parentElement.scrollTop = el.parentElement.scrollHeight; + } }, [transcript]); // Handle completion