diff --git a/webapp/components/create_post.jsx b/webapp/components/create_post.jsx
index 30af8dd302..4ec2bec388 100644
--- a/webapp/components/create_post.jsx
+++ b/webapp/components/create_post.jsx
@@ -494,7 +494,7 @@ export default class CreatePost extends React.Component {
let postError = null;
if (this.state.postError) {
- const postErrorClass = 'control-label post-error' + (this.state.errorClass ? (' ' + this.state.errorClass) : '');
+ const postErrorClass = 'post-error' + (this.state.errorClass ? (' ' + this.state.errorClass) : '');
postError = ;
}
diff --git a/webapp/components/edit_post_modal.jsx b/webapp/components/edit_post_modal.jsx
index a5bccfb803..1617d9f65b 100644
--- a/webapp/components/edit_post_modal.jsx
+++ b/webapp/components/edit_post_modal.jsx
@@ -47,7 +47,8 @@ export default class EditPostModal extends React.Component {
channel_id: '',
comments: 0,
refocusId: '',
- ctrlSend: PreferenceStore.getBool(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, 'send_on_ctrl_enter')
+ ctrlSend: PreferenceStore.getBool(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, 'send_on_ctrl_enter'),
+ postError: ''
};
}
@@ -58,6 +59,14 @@ export default class EditPostModal extends React.Component {
channel_id: this.state.channel_id
};
+ if (this.state.postError) {
+ this.setState({errorClass: 'animation--highlight'});
+ setTimeout(() => {
+ this.setState({errorClass: null});
+ }, Constants.ANIMATION_TIMEOUT);
+ return;
+ }
+
if (updatedPost.message === this.state.originalText) {
// no changes so just close the modal
$('#edit_post').modal('hide');
@@ -90,9 +99,25 @@ export default class EditPostModal extends React.Component {
}
handleChange(e) {
+ const message = e.target.value;
this.setState({
- editText: e.target.value
+ editText: message
});
+
+ if (message.length > Constants.CHARACTER_LIMIT) {
+ const errorMessage = (
+