From 9f7084611d8f1147ac19a14a6a61c2d1a8ef0a97 Mon Sep 17 00:00:00 2001
From: JoramWilander <jwawilander@gmail.com>
Date: Fri, 4 Sep 2015 09:26:15 -0400
Subject: Make onHeightChange not required.

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

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

diff --git a/web/react/components/textbox.jsx b/web/react/components/textbox.jsx
index b4518fe80..ea8126bec 100644
--- a/web/react/components/textbox.jsx
+++ b/web/react/components/textbox.jsx
@@ -242,7 +242,7 @@ export default class Textbox extends React.Component {
         const e = React.findDOMNode(this.refs.message);
         const w = React.findDOMNode(this.refs.wrapper);
 
-        let prevHeight = $(e).height();
+        const prevHeight = $(e).height();
 
         const lht = parseInt($(e).css('lineHeight'), 10);
         const lines = e.scrollHeight / lht;
@@ -260,7 +260,7 @@ export default class Textbox extends React.Component {
             $(w).css({height: 'auto'}).height(167);
         }
 
-        if (prevHeight !== $(e).height()) {
+        if (prevHeight !== $(e).height() && this.props.onHeightChange) {
             this.props.onHeightChange();
         }
     }
@@ -320,6 +320,6 @@ Textbox.propTypes = {
     messageText: React.PropTypes.string.isRequired,
     onUserInput: React.PropTypes.func.isRequired,
     onKeyPress: React.PropTypes.func.isRequired,
-    onHeightChange: React.PropTypes.func.isRequired,
+    onHeightChange: React.PropTypes.func,
     createMessage: React.PropTypes.string.isRequired
 };
-- 
cgit v1.2.3-1-g7c22

