diff --git a/app/components/index.tsx b/app/components/index.tsx index 8f610f2..b582476 100644 --- a/app/components/index.tsx +++ b/app/components/index.tsx @@ -179,9 +179,15 @@ const Main: FC = () => { const [chatList, setChatList, getChatList] = useGetState([]) const chatListDomRef = useRef(null) useEffect(() => { - // scroll to bottom - if (chatListDomRef.current) - chatListDomRef.current.scrollTop = chatListDomRef.current.scrollHeight + // scroll to bottom with page-level scrolling + if (chatListDomRef.current) { + setTimeout(() => { + chatListDomRef.current?.scrollIntoView({ + behavior: 'auto', + block: 'end', + }) + }, 50) + } }, [chatList, currConversationId]) // user can not edit inputs if user had send message const canEditInputs = !chatList.some(item => item.isAnswer === false) && isNewConversation