Merge branch 'master' into Issue-1024-forgot-password-flow

This commit is contained in:
David Erwin
2017-10-06 15:38:26 -04:00
committed by GitHub
+2 -2
View File
@@ -85,8 +85,8 @@ export class CommentForm extends React.Component {
render() {
const {maxCharCount, submitEnabled, cancelButtonClassName, submitButtonClassName, charCountEnable, body, loadingState} = this.props;
const length = body.length;
const isRespectingMaxCount = (length) => charCountEnable && maxCharCount && length > maxCharCount;
const length = body.trim().length;
const isRespectingMaxCount = (length) => charCountEnable && maxCharCount && length > maxCharCount;
const disableSubmitButton = !length || isRespectingMaxCount(length) || !submitEnabled({body}) || loadingState === 'loading';
const disableCancelButton = loadingState === 'loading';
const disableTextArea = loadingState === 'loading';