From f1a2e4835477c81863625c4460fd363876de0f07 Mon Sep 17 00:00:00 2001
From: JoramWilander <jwawilander@gmail.com>
Date: Wed, 17 Jun 2015 09:23:19 -0400
Subject: fixes mm-1250 mention highlights should now align in textbox

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

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

diff --git a/web/react/components/textbox.jsx b/web/react/components/textbox.jsx
index 45798809f..05fbb57d1 100644
--- a/web/react/components/textbox.jsx
+++ b/web/react/components/textbox.jsx
@@ -78,6 +78,8 @@ module.exports = React.createClass({
             var re = new RegExp('( |^)@' + m + '( |$|\n)', 'm');
             html = html.replace(re, '$1<span class="mention">@'+m+'</span>$2');
         }
+        var re2 = new RegExp('(^$)(?![.\n])', 'gm');
+        html = html.replace(re2, '<br/><br/>');
         $(this.refs.textdiv.getDOMNode()).html(html);
     },
     handleChange: function() {
@@ -262,6 +264,8 @@ module.exports = React.createClass({
             $(d).css({'height':'auto','overflow-y':'scroll'}).height(167);
             $(w).css({'height':'auto'}).height(167);
         }
+
+        $(d).scrollTop($(e).scrollTop());
     },
     handleFocus: function() {
         var elm = this.refs.message.getDOMNode();
-- 
cgit v1.2.3-1-g7c22

