mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
Including missing validation check
The validation check was removed from the update to the CommentForm handleSubmit function.
This commit is contained in:
@@ -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 = '';
|
||||
|
||||
Reference in New Issue
Block a user