From 5f9310f622029ab46b7f4c2ced31874a4fc7c110 Mon Sep 17 00:00:00 2001 From: josc146 Date: Mon, 12 Jun 2023 21:58:25 +0800 Subject: [PATCH] improve conversation scroll (#382) --- src/components/ConversationCard/index.jsx | 9 +-------- src/config/index.mjs | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/components/ConversationCard/index.jsx b/src/components/ConversationCard/index.jsx index 0120e20..8cf8f10 100644 --- a/src/components/ConversationCard/index.jsx +++ b/src/components/ConversationCard/index.jsx @@ -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]) diff --git a/src/config/index.mjs b/src/config/index.mjs index bc42df7..1eb6831 100644 --- a/src/config/index.mjs +++ b/src/config/index.mjs @@ -105,7 +105,7 @@ export const defaultConfig = { preferredLanguage: getNavigatorLanguage(), clickIconAction: 'popup', insertAtTop: isMobile(), - lockWhenAnswer: false, + lockWhenAnswer: true, answerScrollMargin: 200, autoRegenAfterSwitchModel: false, selectionToolsNextToInputBox: false,