Don't autofit immediately if a scrollbar is visible at max height

This commit is contained in:
Cohee 2024-07-12 21:01:15 +03:00
parent 3acd60fcab
commit 63ddb81ef7
1 changed files with 2 additions and 1 deletions

View File

@ -882,7 +882,8 @@ export function initRossMods() {
});
$(sendTextArea).on('input', () => {
if (sendTextArea.scrollHeight > sendTextArea.offsetHeight || sendTextArea.value === '') {
const scrollbarShown = sendTextArea.clientWidth < sendTextArea.offsetWidth && sendTextArea.offsetHeight >= window.innerHeight / 2;
if ((sendTextArea.scrollHeight > sendTextArea.offsetHeight && !scrollbarShown) || sendTextArea.value === '') {
autoFitSendTextArea();
} else {
autoFitSendTextAreaDebounced();