Fixing post title height. Fixes #147

This commit is contained in:
Dessalines 2021-01-27 10:29:01 -05:00
parent 9d94cc9094
commit cab454dd89

View file

@ -37,6 +37,7 @@ import {
wsClient, wsClient,
authField, authField,
} from '../utils'; } from '../utils';
import autosize from 'autosize';
var Choices; var Choices;
if (isBrowser()) { if (isBrowser()) {
@ -125,6 +126,10 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
componentDidMount() { componentDidMount() {
setupTippy(); setupTippy();
this.setupCommunities(); this.setupCommunities();
let textarea: any = document.getElementById('post-title');
if (textarea) {
autosize(textarea);
}
} }
componentDidUpdate() { componentDidUpdate() {
@ -252,7 +257,7 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
!validTitle(this.state.postForm.name) && 'is-invalid' !validTitle(this.state.postForm.name) && 'is-invalid'
}`} }`}
required required
rows={2} rows={1}
minLength={3} minLength={3}
maxLength={MAX_POST_TITLE_LENGTH} maxLength={MAX_POST_TITLE_LENGTH}
/> />