From 06a7c5e5d72cac9abf07f4204bb94595fa7a9626 Mon Sep 17 00:00:00 2001
From: JoramWilander <jwawilander@gmail.com>
Date: Fri, 25 Sep 2015 12:06:43 -0400
Subject: Fixes RHS not scrolling to show previews when file attached.

---
 web/react/components/create_comment.jsx | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'web/react/components/create_comment.jsx')

diff --git a/web/react/components/create_comment.jsx b/web/react/components/create_comment.jsx
index 99f553c0c..5097b3aa5 100644
--- a/web/react/components/create_comment.jsx
+++ b/web/react/components/create_comment.jsx
@@ -43,6 +43,12 @@ export default class CreateComment extends React.Component {
             submitting: false
         };
     }
+    componentDidUpdate(prevProps, prevState) {
+        if (prevState.uploadsInProgress < this.state.uploadsInProgress) {
+            $('.post-right__scroll').scrollTop($('.post-right__scroll')[0].scrollHeight);
+            $('.post-right__scroll').perfectScrollbar('update');
+        }
+    }
     handleSubmit(e) {
         e.preventDefault();
 
-- 
cgit v1.2.3-1-g7c22

