Remove getComputedStyle calls

This commit is contained in:
Cohee
2024-07-12 16:01:20 +00:00
parent a57d994913
commit 684ce999f3
2 changed files with 4 additions and 9 deletions

View File

@@ -9234,12 +9234,10 @@ jQuery(async function () {
* @param {HTMLTextAreaElement} e Textarea element to auto-fit
*/
function autoFitEditTextArea(e) {
const computedStyle = window.getComputedStyle(e);
const maxHeight = parseInt(computedStyle.maxHeight, 10);
scroll_holder = chatElement[0].scrollTop;
e.style.height = computedStyle.minHeight;
e.style.height = '0px';
const newHeight = e.scrollHeight + 4;
e.style.height = (newHeight < maxHeight) ? `${newHeight}px` : `${maxHeight}px`;
e.style.height = `${newHeight}px`;
is_use_scroll_holder = true;
}
const autoFitEditTextAreaDebounced = debouncedThrottle(autoFitEditTextArea, debounce_timeout.short);