summaryrefslogtreecommitdiffstats
path: root/ui/src/components/post.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-03-30 17:38:54 -0700
committerDessalines <tyhou13@gmx.com>2019-03-30 17:38:54 -0700
commit923110c7d4c94f9c5aab329bc8c80d59a7e32007 (patch)
tree6ee2d39f00abb8d3368fc3c8a37d3927990e02f2 /ui/src/components/post.tsx
parent6138c6193b9a07fd47d1c1982db613a11fcf5a29 (diff)
Adding textarea autosize to content fields on post
Diffstat (limited to 'ui/src/components/post.tsx')
-rw-r--r--ui/src/components/post.tsx9
1 files changed, 9 insertions, 0 deletions
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<any, State> {
this.subscription.unsubscribe();
}
+ componentDidMount() {
+ autosize(document.querySelectorAll('textarea'));
+ }
+
render() {
return (
<div class="container">
@@ -424,6 +429,10 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
}
}
+ componentDidMount() {
+ autosize(document.querySelectorAll('textarea'));
+ }
+
render() {
return (
<div>