fix: simplify height adjustment logic for text area and markdown container

This commit is contained in:
2026-02-05 16:04:16 -05:00
parent 54ca2ee641
commit f37e647a1c
+2 -10
View File
@@ -65,17 +65,9 @@
let max: number;
let element = markdown ? markdownConatiner : textArea;
if (!markdown) {
textArea.style.height = 'auto';
h = textArea.scrollHeight;
element.style.height = 'auto';
h = element.scrollHeight;
max = MAX_HEIGHT();
} else {
markdownConatiner.style.height = 'auto';
h = markdownConatiner.scrollHeight;
max = MAX_HEIGHT();
}
if (h > max) {
element.style.height = max + 'px';