Including missing validation check

The validation check was removed from the update to the CommentForm handleSubmit function.
This commit is contained in:
Michael Randers-Pehrson
2014-08-21 23:00:05 -04:00
parent 8f5a2e564d
commit 65874732b0

View File

@@ -565,6 +565,9 @@ var CommentForm = React.createClass({
handleSubmit: function() {
var author = this.refs.author.getDOMNode().value.trim();
var text = this.refs.text.getDOMNode().value.trim();
if (!text || !author) {
return false;
}
this.props.onCommentSubmit({author: author, text: text});
this.refs.author.getDOMNode().value = '';
this.refs.text.getDOMNode().value = '';