mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-05 18:48:41 +00:00
fix: simplify height adjustment logic for text area and markdown container
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user