From: Dessalines Date: Sat, 25 Jan 2020 02:53:37 +0000 (-0500) Subject: Comment image uploads resize textarea. Fixes #460 X-Git-Url: http://these/git/%22%7Bauthor_url%7D/static/%24%7Bargs.thread.url%7D?a=commitdiff_plain;h=7e6842e63a84d8fa97135ec1d94342e5b10e5dc5;p=lemmy.git Comment image uploads resize textarea. Fixes #460 --- diff --git a/ui/src/components/comment-form.tsx b/ui/src/components/comment-form.tsx index f4eb1181..e4543d66 100644 --- a/ui/src/components/comment-form.tsx +++ b/ui/src/components/comment-form.tsx @@ -225,13 +225,15 @@ export class CommentForm extends Component { .then(res => res.json()) .then(res => { let url = `${window.location.origin}/pictshare/${res.url}`; - let markdown = + let imageMarkdown = res.filetype == 'mp4' ? `[vid](${url}/raw)` : `![](${url})`; let content = i.state.commentForm.content; - content = content ? `${content} ${markdown}` : markdown; + content = content ? `${content}\n${imageMarkdown}` : imageMarkdown; i.state.commentForm.content = content; i.state.imageLoading = false; i.setState(i.state); + var textarea: any = document.getElementById(i.id); + autosize.update(textarea); }) .catch(error => { i.state.imageLoading = false;