Calculate new height after setting min height

This commit is contained in:
Cohee 2024-07-12 07:29:42 +00:00
parent 4c7e5fbd60
commit a57d994913
1 changed files with 1 additions and 1 deletions

View File

@ -9236,9 +9236,9 @@ jQuery(async function () {
function autoFitEditTextArea(e) {
const computedStyle = window.getComputedStyle(e);
const maxHeight = parseInt(computedStyle.maxHeight, 10);
const newHeight = e.scrollHeight + 4;
scroll_holder = chatElement[0].scrollTop;
e.style.height = computedStyle.minHeight;
const newHeight = e.scrollHeight + 4;
e.style.height = (newHeight < maxHeight) ? `${newHeight}px` : `${maxHeight}px`;
is_use_scroll_holder = true;
}