From 923110c7d4c94f9c5aab329bc8c80d59a7e32007 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 30 Mar 2019 17:38:54 -0700 Subject: Adding textarea autosize to content fields on post --- ui/src/components/post.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ui/src/components/post.tsx') diff --git a/ui/src/components/post.tsx b/ui/src/components/post.tsx index adb90840..adcc8616 100644 --- a/ui/src/components/post.tsx +++ b/ui/src/components/post.tsx @@ -5,6 +5,7 @@ import { UserOperation, Community, Post as PostI, PostResponse, Comment, Comment import { WebSocketService, UserService } from '../services'; import { msgOp, hotRank,mdToHtml } from '../utils'; import { MomentTime } from './moment-time'; +import * as autosize from 'autosize'; interface CommentNodeI { comment: Comment; @@ -54,6 +55,10 @@ export class Post extends Component { this.subscription.unsubscribe(); } + componentDidMount() { + autosize(document.querySelectorAll('textarea')); + } + render() { return (
@@ -424,6 +429,10 @@ export class CommentForm extends Component { } } + componentDidMount() { + autosize(document.querySelectorAll('textarea')); + } + render() { return (
-- cgit v1.2.3