diff options
author | Reed Garmsen <rgarmsen2295@gmail.com> | 2015-08-25 12:47:18 -0700 |
---|---|---|
committer | Reed Garmsen <rgarmsen2295@gmail.com> | 2015-08-25 13:16:44 -0700 |
commit | 656a88efdd2606ce8449097e740535f41aee9d64 (patch) | |
tree | 81ef9d460452ece278c6b7885919edcd4c21255d /web/react/components/create_post.jsx | |
parent | 5766bbfc65e3f6663737da5d15359d68e3f991ff (diff) | |
download | chat-656a88efdd2606ce8449097e740535f41aee9d64.tar.gz chat-656a88efdd2606ce8449097e740535f41aee9d64.tar.bz2 chat-656a88efdd2606ce8449097e740535f41aee9d64.zip |
Fixed issue with carriage returns being counted improperly in non-ie browsers and updated error messages to be appropriate to what is being typed (message vs. post vs. edit)
Diffstat (limited to 'web/react/components/create_post.jsx')
-rw-r--r-- | web/react/components/create_post.jsx | 6 |
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 = ''; } |