From df07aeeb126954ed14e393a3a09d28c4bbf630fb Mon Sep 17 00:00:00 2001
From: Harrison Healey <harrisonmhealey@gmail.com>
Date: Tue, 28 Feb 2017 18:51:11 -0500
Subject: Fixed pasting text sending the caret to the end of the post textbox
 (#5567)

---
 webapp/components/file_upload.jsx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'webapp/components/file_upload.jsx')

diff --git a/webapp/components/file_upload.jsx b/webapp/components/file_upload.jsx
index 5710f2365..e1535c0bb 100644
--- a/webapp/components/file_upload.jsx
+++ b/webapp/components/file_upload.jsx
@@ -292,9 +292,11 @@ class FileUpload extends React.Component {
 
                 this.props.onUploadStart([clientId], channelId);
             }
-        }
 
-        this.props.onFileUploadChange();
+            if (numToUpload > 0) {
+                this.props.onFileUploadChange();
+            }
+        }
     }
 
     keyUpload(e) {
-- 
cgit v1.2.3-1-g7c22

