diff --git a/public/script.js b/public/script.js index 13ece6069..49d8c7e50 100644 --- a/public/script.js +++ b/public/script.js @@ -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); diff --git a/public/scripts/RossAscends-mods.js b/public/scripts/RossAscends-mods.js index 5c56b3be5..fefaecf66 100644 --- a/public/scripts/RossAscends-mods.js +++ b/public/scripts/RossAscends-mods.js @@ -694,16 +694,13 @@ const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; * this makes the chat input text area resize vertically to match the text size (limited by CSS at 50% window height) */ function autoFitSendTextArea() { - // Needs to be pulled dynamically because it is affected by font size changes - const computedStyle = window.getComputedStyle(sendTextArea); const originalScrollBottom = chatBlock.scrollHeight - (chatBlock.scrollTop + chatBlock.offsetHeight); if (Math.ceil(sendTextArea.scrollHeight + 3) >= Math.floor(sendTextArea.offsetHeight)) { - const sendTextAreaMinHeight = computedStyle.minHeight; + const sendTextAreaMinHeight = '0px'; sendTextArea.style.height = sendTextAreaMinHeight; } - const maxHeight = parseInt(computedStyle.maxHeight, 10); const newHeight = sendTextArea.scrollHeight + 3; - sendTextArea.style.height = (newHeight < maxHeight) ? `${newHeight}px` : `${maxHeight}px`; + sendTextArea.style.height = `${newHeight}px`; if (!isFirefox) { const newScrollTop = Math.round(chatBlock.scrollHeight - (chatBlock.offsetHeight + originalScrollBottom));