fix: scroll to top and not to bottom

This commit is contained in:
Niklas 2023-03-24 14:56:38 +01:00
parent 4810f7425b
commit 74122dd723
1 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ export const ChatHistoryView: FC<{}> = props => {
}, [chatHistory, searchText]);
useEffect(() => {
if (elementRef && elementRef.current && isVisible) elementRef.current.scrollTop = elementRef.current.scrollHeight;
if (elementRef && elementRef.current && isVisible) elementRef.current.scrollTop = 0;
}, [isVisible]);
useEffect(() => {
@ -68,7 +68,7 @@ export const ChatHistoryView: FC<{}> = props => {
/>
<InfiniteScroll
rows={filteredChatHistory}
scrollToBottom={true}
scrollToBottom={false}
rowRender={row => {
return (
<Flex alignItems="center" className="p-1" gap={2}>