Skip to content

Commit

Permalink
Always scroll to the bottom of the chat log regardless of the scroll …
Browse files Browse the repository at this point in the history
…position of the div fixes blocktronics#203
  • Loading branch information
andyherbert committed May 12, 2022
1 parent b46a112 commit b84fde4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/document/ui/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ class ChatUI extends events.EventEmitter {
const scroll = is_at_bottom();
if (container) child = this.create_div({child});
$("messages").appendChild(child);
if (scroll) scroll_to_bottom();
// if (scroll) scroll_to_bottom();
scroll_to_bottom();
}

create_div({classname, text, parent, child, linkify = false} = {}) {
Expand Down Expand Up @@ -220,7 +221,8 @@ class ChatUI extends events.EventEmitter {
const scroll = is_at_bottom();
const new_height = $("chat").getBoundingClientRect().bottom - event.clientY;
set_var("chat-height", Math.max(new_height, 96));
if (scroll) scroll_to_bottom();
// if (scroll) scroll_to_bottom();
scroll_to_bottom();
this.emit("update_frame");
}
}
Expand Down

0 comments on commit b84fde4

Please sign in to comment.