mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-07-20 12:20:31 +08:00
improve conversation scroll (#382)
This commit is contained in:
@@ -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])
|
||||
|
||||
@@ -105,7 +105,7 @@ export const defaultConfig = {
|
||||
preferredLanguage: getNavigatorLanguage(),
|
||||
clickIconAction: 'popup',
|
||||
insertAtTop: isMobile(),
|
||||
lockWhenAnswer: false,
|
||||
lockWhenAnswer: true,
|
||||
answerScrollMargin: 200,
|
||||
autoRegenAfterSwitchModel: false,
|
||||
selectionToolsNextToInputBox: false,
|
||||
|
||||
Reference in New Issue
Block a user