From a57d9949133f039aa31839ba41d8c037da16f4c9 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Fri, 12 Jul 2024 07:29:42 +0000 Subject: [PATCH] Calculate new height after setting min height --- public/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/script.js b/public/script.js index b6820e313..13ece6069 100644 --- a/public/script.js +++ b/public/script.js @@ -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; }