Browse Source

polish[#1176]: Chat now auto-scrolls while typing if you are at max scroll position already

tags/v0.8.1^2
Shaun 3 years ago
parent
commit
bae8a0c0a1
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      src/client/ui/templates/messages/messages.js

+ 4
- 1
src/client/ui/templates/messages/messages.js View File

@@ -193,6 +193,9 @@ define([

let container = this.find('.list');

const [ { scrollHeight, clientHeight, scrollTop } ] = container;
const isAtMaxScroll = scrollTop >= (scrollHeight - clientHeight);

messages.forEach(m => {
this.trackHistory(m);

@@ -246,7 +249,7 @@ define([
}
});

if (!this.el.hasClass('typing'))
if (!this.el.hasClass('typing') || isAtMaxScroll)
container.scrollTop(9999999);
},



Loading…
Cancel
Save