mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Invert if cssAutofit
This commit is contained in:
@@ -916,7 +916,12 @@ export function initRossMods() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sendTextArea.addEventListener('input', () => {
|
sendTextArea.addEventListener('input', () => {
|
||||||
if (!cssAutofit) {
|
saveUserInputDebounced();
|
||||||
|
|
||||||
|
if (cssAutofit) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const hasContent = sendTextArea.value !== '';
|
const hasContent = sendTextArea.value !== '';
|
||||||
const fitsCurrentSize = sendTextArea.scrollHeight <= sendTextArea.offsetHeight;
|
const fitsCurrentSize = sendTextArea.scrollHeight <= sendTextArea.offsetHeight;
|
||||||
const isScrollbarShown = sendTextArea.clientWidth < sendTextArea.offsetWidth;
|
const isScrollbarShown = sendTextArea.clientWidth < sendTextArea.offsetWidth;
|
||||||
@@ -924,8 +929,6 @@ export function initRossMods() {
|
|||||||
const needsDebounce = hasContent && (fitsCurrentSize || (isScrollbarShown && isHalfScreenHeight));
|
const needsDebounce = hasContent && (fitsCurrentSize || (isScrollbarShown && isHalfScreenHeight));
|
||||||
if (needsDebounce) autoFitSendTextAreaDebounced();
|
if (needsDebounce) autoFitSendTextAreaDebounced();
|
||||||
else autoFitSendTextArea();
|
else autoFitSendTextArea();
|
||||||
}
|
|
||||||
saveUserInputDebounced();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
restoreUserInput();
|
restoreUserInput();
|
||||||
|
Reference in New Issue
Block a user