mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Save chat scroll position when user input overflows the line
This commit is contained in:
@ -62,11 +62,11 @@ const generateDebounced = debounce(() => generateHypeBot(), 500);
|
||||
* @param {string} text Text to set
|
||||
*/
|
||||
function setHypeBotText(text) {
|
||||
const blockA = $('#chat');
|
||||
var originalScrollBottom = blockA[0].scrollHeight - (blockA.scrollTop() + blockA.outerHeight());
|
||||
const chatBlock = $('#chat');
|
||||
const originalScrollBottom = chatBlock[0].scrollHeight - (chatBlock.scrollTop() + chatBlock.outerHeight());
|
||||
hypeBotBar.html(DOMPurify.sanitize(text));
|
||||
var newScrollTop = blockA[0].scrollHeight - (blockA.outerHeight() + originalScrollBottom);
|
||||
blockA.scrollTop(newScrollTop);
|
||||
const newScrollTop = chatBlock[0].scrollHeight - (chatBlock.outerHeight() + originalScrollBottom);
|
||||
chatBlock.scrollTop(newScrollTop);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user