From b78145a4f5aa18cc99cc712929279e3f86676d3b Mon Sep 17 00:00:00 2001 From: Xylight Date: Fri, 6 Sep 2024 17:06:38 -0700 Subject: [PATCH] fix: adjust height automatically, close #294, close #272 --- src/lib/components/lemmy/post/form/PostForm.svelte | 12 +++++++++++- src/lib/components/markdown/MarkdownEditor.svelte | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/lib/components/lemmy/post/form/PostForm.svelte b/src/lib/components/lemmy/post/form/PostForm.svelte index 4ab263bd..2aca87ca 100644 --- a/src/lib/components/lemmy/post/form/PostForm.svelte +++ b/src/lib/components/lemmy/post/form/PostForm.svelte @@ -368,7 +368,17 @@ {/if}
{#if data.url === undefined} - diff --git a/src/lib/components/markdown/MarkdownEditor.svelte b/src/lib/components/markdown/MarkdownEditor.svelte index e5693abf..b31aa0c6 100644 --- a/src/lib/components/markdown/MarkdownEditor.svelte +++ b/src/lib/components/markdown/MarkdownEditor.svelte @@ -88,6 +88,8 @@ textArea.style.height = 'auto' // Reset height to auto to calculate new height textArea.style.height = `${textArea.scrollHeight}px` // Set height to the scrollHeight } + + $: if (textArea && !previewing) adjustHeight() {#if uploadingImage && images} @@ -122,7 +124,6 @@ overflow-hidden transition-colors {$$props.class}" {#if previewing}