Skip to content

Commit

Permalink
possible autoscroll treshhold fix
Browse files Browse the repository at this point in the history
  • Loading branch information
oxyplay committed Nov 15, 2023
1 parent 26ba0af commit 4d0f680
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion assets/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@
let isAutoScrollPaused = false;

function isScrolledToBottom() {
return chatContent.scrollHeight - chatContent.clientHeight <= chatContent.scrollTop + 1;
return chatContent.scrollHeight - chatContent.clientHeight <= chatContent.scrollTop + 5;
}

chatContent.addEventListener('scroll', function() {
Expand Down Expand Up @@ -440,6 +440,7 @@
// new scroll to test
function auto_scroll() {
input_care();
console.log('isAutoScrollPaused',isAutoScrollPaused);
if (!isAutoScrollPaused) {
var currentScroll = chatContent.scrollTop;
var distanceToScroll = chatContent.scrollHeight - chatContent.clientHeight - currentScroll;
Expand Down

0 comments on commit 4d0f680

Please sign in to comment.