Skip to content

Commit 5f9310f

Browse files
committed
improve conversation scroll (#382)
1 parent 454e457 commit 5f9310f

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/components/ConversationCard/index.jsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,6 @@ function ConversationCard(props) {
7777
if (props.onUpdate) props.onUpdate(port, session, conversationItemData)
7878
}, [session, conversationItemData])
7979

80-
useEffect(() => {
81-
bodyRef.current.scrollTo({
82-
top: bodyRef.current.scrollHeight,
83-
behavior: 'instant',
84-
})
85-
}, [session])
86-
8780
useEffect(() => {
8881
const { offsetHeight, scrollHeight, scrollTop } = bodyRef.current
8982
if (
@@ -92,7 +85,7 @@ function ConversationCard(props) {
9285
) {
9386
bodyRef.current.scrollTo({
9487
top: scrollHeight,
95-
behavior: 'smooth',
88+
behavior: 'instant',
9689
})
9790
}
9891
}, [conversationItemData])

src/config/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export const defaultConfig = {
105105
preferredLanguage: getNavigatorLanguage(),
106106
clickIconAction: 'popup',
107107
insertAtTop: isMobile(),
108-
lockWhenAnswer: false,
108+
lockWhenAnswer: true,
109109
answerScrollMargin: 200,
110110
autoRegenAfterSwitchModel: false,
111111
selectionToolsNextToInputBox: false,

0 commit comments

Comments
 (0)