From f703b89c0006be94fa4955cc9ca1e37578298516 Mon Sep 17 00:00:00 2001 From: ajaythapliyal Date: Mon, 27 Feb 2023 07:31:02 +0530 Subject: [PATCH 1/2] 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) => { From 34fb20ce121ddf7d9a7fd21da3c4f1ae49f29b57 Mon Sep 17 00:00:00 2001 From: ajaythapliyal Date: Mon, 27 Feb 2023 07:49:18 +0530 Subject: [PATCH 2/2] increases the bottom margin of conversation UI so that latest message shows up above the input --- frontend/src/conversation/Conversation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index 08f67bc..b8e0cf0 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -36,7 +36,7 @@ export default function Conversation() { return (