Implement autofit for edit textarea

This commit is contained in:
Cohee
2024-12-21 16:47:25 +02:00
parent f649e4698b
commit 2fbe689605
3 changed files with 29 additions and 32 deletions

View File

@@ -890,9 +890,6 @@ export function initRossMods() {
const cssAutofit = CSS.supports('field-sizing', 'content');
if (cssAutofit) {
sendTextArea.style['fieldSizing'] = 'content';
sendTextArea.style['height'] = 'auto';
let lastHeight = chatBlock.offsetHeight;
const chatBlockResizeObserver = new ResizeObserver((entries) => {
for (const entry of entries) {
@@ -919,6 +916,8 @@ export function initRossMods() {
saveUserInputDebounced();
if (cssAutofit) {
// Unset modifications made with a manual resize
sendTextArea.style.height = 'auto';
return;
}