Invert if cssAutofit

f649e4698b749c62c6f3c413605fb77d874f2569

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +12 -9Ignore whitespace
public/scripts/RossAscends-mods.js+12 -9
@@ -916,16 +916,19 @@ export function initRossMods() {
916916 }
917917
918918 sendTextArea.addEventListener('input', () => {
919- if (!cssAutofit) {
920- const hasContent = sendTextArea.value !== '';
921- const fitsCurrentSize = sendTextArea.scrollHeight <= sendTextArea.offsetHeight;
922- const isScrollbarShown = sendTextArea.clientWidth < sendTextArea.offsetWidth;
923- const isHalfScreenHeight = sendTextArea.offsetHeight >= window.innerHeight / 2;
924- const needsDebounce = hasContent && (fitsCurrentSize || (isScrollbarShown && isHalfScreenHeight));
925- if (needsDebounce) autoFitSendTextAreaDebounced();
926- else autoFitSendTextArea();
927- }
928919 saveUserInputDebounced();
920+
921+ if (cssAutofit) {
922+ return;
923+ }
924+
925+ const hasContent = sendTextArea.value !== '';
926+ const fitsCurrentSize = sendTextArea.scrollHeight <= sendTextArea.offsetHeight;
927+ const isScrollbarShown = sendTextArea.clientWidth < sendTextArea.offsetWidth;
928+ const isHalfScreenHeight = sendTextArea.offsetHeight >= window.innerHeight / 2;
929+ const needsDebounce = hasContent && (fitsCurrentSize || (isScrollbarShown && isHalfScreenHeight));
930+ if (needsDebounce) autoFitSendTextAreaDebounced();
931+ else autoFitSendTextArea();
929932 });
930933
931934 restoreUserInput();