mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Firefox: restore chat scroll top on edit textarea autofit
This commit is contained in:
@@ -9732,9 +9732,11 @@ jQuery(async function () {
|
|||||||
* @param {HTMLTextAreaElement} e Textarea element to auto-fit
|
* @param {HTMLTextAreaElement} e Textarea element to auto-fit
|
||||||
*/
|
*/
|
||||||
function autoFitEditTextArea(e) {
|
function autoFitEditTextArea(e) {
|
||||||
|
const scrollTop = chatElement.scrollTop();
|
||||||
e.style.height = '0px';
|
e.style.height = '0px';
|
||||||
const newHeight = e.scrollHeight + 4;
|
const newHeight = e.scrollHeight + 4;
|
||||||
e.style.height = `${newHeight}px`;
|
e.style.height = `${newHeight}px`;
|
||||||
|
chatElement.scrollTop(scrollTop);
|
||||||
}
|
}
|
||||||
const autoFitEditTextAreaDebounced = debounce(autoFitEditTextArea, debounce_timeout.short);
|
const autoFitEditTextAreaDebounced = debounce(autoFitEditTextArea, debounce_timeout.short);
|
||||||
document.addEventListener('input', e => {
|
document.addEventListener('input', e => {
|
||||||
|
Reference in New Issue
Block a user