summaryrefslogtreecommitdiffstats
path: root/web/react/components/create_post.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/components/create_post.jsx')
-rw-r--r--web/react/components/create_post.jsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx
index 242513d07..387149b14 100644
--- a/web/react/components/create_post.jsx
+++ b/web/react/components/create_post.jsx
@@ -134,9 +134,11 @@ module.exports = React.createClass({
handleUserInput: function(messageText) {
var newPostError = this.state.postError;
- if (!this.state.postError && messageText.length >= Constants.MAX_POST_LEN) {
+ var len = utils.getLengthOfTextInTextarea(messageText);
+
+ if (!this.state.postError && len >= Constants.MAX_POST_LEN) {
newPostError = 'Message length cannot exceed 4000 characters';
- } else if (this.state.postError === 'Message length cannot exceed 4000 characters' && messageText.length < Constants.MAX_POST_LEN) {
+ } else if (this.state.postError === 'Message length cannot exceed 4000 characters' && len < Constants.MAX_POST_LEN) {
newPostError = '';
}