mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Calculate new height after setting min height
This commit is contained in:
@ -9236,9 +9236,9 @@ jQuery(async function () {
|
|||||||
function autoFitEditTextArea(e) {
|
function autoFitEditTextArea(e) {
|
||||||
const computedStyle = window.getComputedStyle(e);
|
const computedStyle = window.getComputedStyle(e);
|
||||||
const maxHeight = parseInt(computedStyle.maxHeight, 10);
|
const maxHeight = parseInt(computedStyle.maxHeight, 10);
|
||||||
const newHeight = e.scrollHeight + 4;
|
|
||||||
scroll_holder = chatElement[0].scrollTop;
|
scroll_holder = chatElement[0].scrollTop;
|
||||||
e.style.height = computedStyle.minHeight;
|
e.style.height = computedStyle.minHeight;
|
||||||
|
const newHeight = e.scrollHeight + 4;
|
||||||
e.style.height = (newHeight < maxHeight) ? `${newHeight}px` : `${maxHeight}px`;
|
e.style.height = (newHeight < maxHeight) ? `${newHeight}px` : `${maxHeight}px`;
|
||||||
is_use_scroll_holder = true;
|
is_use_scroll_holder = true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user