mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
Fix scroll behavior
This commit is contained in:
@@ -431,28 +431,31 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
|
|||||||
|
|
||||||
if (isCollapsing && isAtBottom) {
|
if (isCollapsing && isAtBottom) {
|
||||||
const timer = setTimeout(() => {
|
const timer = setTimeout(() => {
|
||||||
if (virtuosoRef.current) {
|
virtuosoRef.current?.scrollToIndex({
|
||||||
virtuosoRef.current.scrollToIndex({
|
|
||||||
index: visibleMessages.length - 1,
|
index: visibleMessages.length - 1,
|
||||||
align: "end",
|
align: "end",
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}, 0)
|
}, 0)
|
||||||
return () => clearTimeout(timer)
|
return () => clearTimeout(timer)
|
||||||
}
|
} else if (isLastMessage) {
|
||||||
|
if (isCollapsing) {
|
||||||
if (!isCollapsing && isLastMessage) {
|
|
||||||
const timer = setTimeout(() => {
|
const timer = setTimeout(() => {
|
||||||
if (virtuosoRef.current) {
|
virtuosoRef.current?.scrollToIndex({
|
||||||
virtuosoRef.current.scrollToIndex({
|
index: visibleMessages.length - 1,
|
||||||
|
align: "end",
|
||||||
|
})
|
||||||
|
}, 0)
|
||||||
|
return () => clearTimeout(timer)
|
||||||
|
} else {
|
||||||
|
const timer = setTimeout(() => {
|
||||||
|
virtuosoRef.current?.scrollToIndex({
|
||||||
index: visibleMessages.length - 1,
|
index: visibleMessages.length - 1,
|
||||||
align: "start",
|
align: "start",
|
||||||
behavior: "smooth",
|
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}, 0)
|
}, 0)
|
||||||
return () => clearTimeout(timer)
|
return () => clearTimeout(timer)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
[isAtBottom, visibleMessages, expandedRows]
|
[isAtBottom, visibleMessages, expandedRows]
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user