From f703b89c0006be94fa4955cc9ca1e37578298516 Mon Sep 17 00:00:00 2001 From: ajaythapliyal Date: Mon, 27 Feb 2023 07:31:02 +0530 Subject: [PATCH] disables chat scroll when nav state is modified --- frontend/src/conversation/Conversation.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index 2102ec2..08f67bc 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -19,8 +19,9 @@ export default function Conversation() { const endMessageRef = useRef(null); const inputRef = useRef(null); - useEffect(() => - endMessageRef?.current?.scrollIntoView({ behavior: 'smooth' }), + useEffect( + () => endMessageRef?.current?.scrollIntoView({ behavior: 'smooth' }), + [messages], ); const handleQuestion = (question: string) => {