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:
		@@ -863,8 +863,12 @@ export function initRossMods() {
 | 
			
		||||
 | 
			
		||||
    //this makes the chat input text area resize vertically to match the text size (limited by CSS at 50% window height)
 | 
			
		||||
    $('#send_textarea').on('input', function () {
 | 
			
		||||
        const chatBlock = $('#chat');
 | 
			
		||||
        const originalScrollBottom = chatBlock[0].scrollHeight - (chatBlock.scrollTop() + chatBlock.outerHeight());
 | 
			
		||||
        this.style.height = window.getComputedStyle(this).getPropertyValue('min-height');
 | 
			
		||||
        this.style.height = (this.scrollHeight) + 'px';
 | 
			
		||||
        const newScrollTop = chatBlock[0].scrollHeight - (chatBlock.outerHeight() + originalScrollBottom);
 | 
			
		||||
        chatBlock.scrollTop(newScrollTop);
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    //Regenerate if user swipes on the last mesage in chat
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user