improve conversation scroll (#382)

This commit is contained in:
josc146
2023-06-12 21:58:25 +08:00
parent 454e457656
commit 5f9310f622
2 changed files with 2 additions and 9 deletions
+1 -8
View File
@@ -77,13 +77,6 @@ function ConversationCard(props) {
if (props.onUpdate) props.onUpdate(port, session, conversationItemData)
}, [session, conversationItemData])
useEffect(() => {
bodyRef.current.scrollTo({
top: bodyRef.current.scrollHeight,
behavior: 'instant',
})
}, [session])
useEffect(() => {
const { offsetHeight, scrollHeight, scrollTop } = bodyRef.current
if (
@@ -92,7 +85,7 @@ function ConversationCard(props) {
) {
bodyRef.current.scrollTo({
top: scrollHeight,
behavior: 'smooth',
behavior: 'instant',
})
}
}, [conversationItemData])
+1 -1
View File
@@ -105,7 +105,7 @@ export const defaultConfig = {
preferredLanguage: getNavigatorLanguage(),
clickIconAction: 'popup',
insertAtTop: isMobile(),
lockWhenAnswer: false,
lockWhenAnswer: true,
answerScrollMargin: 200,
autoRegenAfterSwitchModel: false,
selectionToolsNextToInputBox: false,