mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-24 07:58:00 +01:00
Firefox: restore chat scroll top on edit textarea autofit
This commit is contained in:
parent
e33e0b1e64
commit
0d79bb6f6d
@ -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 => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user