Skip to content

Commit 10b7327

Browse files
author
Jicheng Lu
committed
fix message scroll
1 parent e650b63 commit 10b7327

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/routes/chat/[agentId]/[conversationId]/chat-box.svelte

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -779,8 +779,7 @@
779779
/** @param {string} messageId */
780780
function autoScrollToTargetLog(messageId) {
781781
const contentLogWrapper = '.content-log-scrollbar';
782-
const stateLogWrapper = '.state-log-scrollbar';
783-
const offset = 5;
782+
const stateLogWrapper = '.conv-state-log-scrollbar';
784783
const elements = [];
785784
const contentLogElm = document.querySelector(`#content-log-${messageId}`);
786785
if (isLoadContentLog && !!contentLogElm) {
@@ -803,11 +802,7 @@
803802
if (!!scrollElement && !!item.elm) {
804803
const logScroll = OverlayScrollbars(scrollElement, options);
805804
const { viewport } = logScroll.elements();
806-
let offsetTop = item.elm.offsetTop;
807-
// if (item.wrapperName === stateLogWrapper) {
808-
// offsetTop -= offset;
809-
// }
810-
offsetTop -= offset + 10;
805+
const offsetTop = item.elm.offsetTop;
811806
viewport.scrollTo({ top: offsetTop, behavior: 'smooth' });
812807
}
813808
});

0 commit comments

Comments
 (0)