]> Untitled Git - lemmy-ui.git/commitdiff
Fixing post title height. Fixes #147
authorDessalines <tyhou13@gmx.com>
Wed, 27 Jan 2021 15:29:01 +0000 (10:29 -0500)
committerDessalines <tyhou13@gmx.com>
Wed, 27 Jan 2021 15:29:01 +0000 (10:29 -0500)
src/shared/components/post-form.tsx

index 08a5014bf950273f126d08c28fece82776fd04d2..4295a623c6df801cef76580f2dd1d359803e8f66 100644 (file)
@@ -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}
               />