Skip to content

Commit

Permalink
fix(chat): Scroll to time ago element (#1350)
Browse files Browse the repository at this point in the history
Co-authored-by: Flemmli97 <Flemmli97@users.noreply.github.com>
Co-authored-by: Phill Wisniewski <93608357+phillsatellite@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 19, 2023
1 parent 2e7cbe1 commit 1c68c1e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ui/src/layouts/chats/scripts/scroll_to_bottom.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
// returns for eval
var message = document.getElementById("$MESSAGE_ID");
var time = message.parentElement.parentElement.getElementsByClassName("time-ago")[0];
// try find the time-ago element
if (time) {
message = time;
}
message.scrollIntoView({ behavior: 'instant', block: 'end' });
return "done";

0 comments on commit 1c68c1e

Please sign in to comment.