From cab454dd89f65d74948214762e8a99c6cd093647 Mon Sep 17 00:00:00 2001 From: Dessalines <tyhou13@gmx.com> Date: Wed, 27 Jan 2021 10:29:01 -0500 Subject: [PATCH] Fixing post title height. Fixes #147 --- src/shared/components/post-form.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/shared/components/post-form.tsx b/src/shared/components/post-form.tsx index 08a5014..4295a62 100644 --- a/src/shared/components/post-form.tsx +++ b/src/shared/components/post-form.tsx @@ -37,6 +37,7 @@ import { wsClient, authField, } from '../utils'; +import autosize from 'autosize'; var Choices; if (isBrowser()) { @@ -125,6 +126,10 @@ export class PostForm extends Component<PostFormProps, PostFormState> { componentDidMount() { setupTippy(); this.setupCommunities(); + let textarea: any = document.getElementById('post-title'); + if (textarea) { + autosize(textarea); + } } componentDidUpdate() { @@ -252,7 +257,7 @@ export class PostForm extends Component<PostFormProps, PostFormState> { !validTitle(this.state.postForm.name) && 'is-invalid' }`} required - rows={2} + rows={1} minLength={3} maxLength={MAX_POST_TITLE_LENGTH} /> -- 2.44.1