mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +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 max: number;
|
||||||
let element = markdown ? markdownConatiner : textArea;
|
let element = markdown ? markdownConatiner : textArea;
|
||||||
|
|
||||||
if (!markdown) {
|
element.style.height = 'auto';
|
||||||
textArea.style.height = 'auto';
|
h = element.scrollHeight;
|
||||||
|
|
||||||
h = textArea.scrollHeight;
|
|
||||||
max = MAX_HEIGHT();
|
max = MAX_HEIGHT();
|
||||||
} else {
|
|
||||||
markdownConatiner.style.height = 'auto';
|
|
||||||
|
|
||||||
h = markdownConatiner.scrollHeight;
|
|
||||||
max = MAX_HEIGHT();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (h > max) {
|
if (h > max) {
|
||||||
element.style.height = max + 'px';
|
element.style.height = max + 'px';
|
||||||
|
|||||||
Reference in New Issue
Block a user