We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb14963 commit b9891b1Copy full SHA for b9891b1
1 file changed
src/main.js
@@ -415,7 +415,11 @@ class AIAssistant {
415
this.updateMessage(aiMessageElement, response, app);
416
417
const chatAreaAfter = app.querySelector("#ai-chat-area");
418
- if (chatAreaAfter) chatAreaAfter.scrollTop = chatAreaAfter.scrollHeight;
+ if (chatAreaAfter) {
419
+ requestAnimationFrame(() => {
420
+ chatAreaAfter.scrollTop = chatAreaAfter.scrollHeight;
421
+ });
422
+ }
423
424
if (!this.currentSession) {
425
this.currentSession = {
@@ -461,7 +465,9 @@ class AIAssistant {
461
465
messageDiv.appendChild(messageContent);
462
466
chatArea.appendChild(messageDiv);
463
467
464
- chatArea.scrollTop = chatArea.scrollHeight;
468
469
+ chatArea.scrollTop = chatArea.scrollHeight;
470
471
472
return messageContent;
473
}
0 commit comments