File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
src/routes/chat/[agentId]/[conversationId] Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 468468 function directToLog (messageId ) {
469469 if (!!! messageId || isLite) return ;
470470
471+ const elements = [];
471472 const contentLogElm = document .querySelector (` #content-log-${ messageId} ` );
472- const stateLogElm = document .querySelector (` #state-log-${ messageId} ` );
473473 if (!! contentLogElm) {
474- contentLogElm .scrollIntoView ({
475- behavior: ' smooth'
474+ elements .push ({
475+ elm: contentLogElm,
476+ wrapperName: ' .content-log-scrollbar'
476477 });
477478 }
478479
480+ const stateLogElm = document .querySelector (` #state-log-${ messageId} ` );
479481 if (!! stateLogElm) {
480- stateLogElm .scrollIntoView ({
481- behavior: ' smooth'
482+ elements .push ({
483+ elm: stateLogElm,
484+ wrapperName: ' .state-log-scrollbar'
482485 });
483486 }
487+
488+ elements .forEach (item => {
489+ const scrollElement = document .querySelector (item .wrapperName );
490+ const logScroll = OverlayScrollbars (scrollElement, options);
491+ const { viewport } = logScroll .elements ();
492+ viewport .scrollTo ({ top: item .elm .offsetTop , behavior: ' smooth' });
493+ });
484494 }
485495< / script>
486496
You can’t perform that action at this time.
0 commit comments