0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-26 22:32:45 +00:00

Added QoL, where if errors are present, we run the checker on text input to give quicker feedback

This commit is contained in:
Scott Tolksdorf
2016-09-15 09:19:10 -04:00
parent 9f05556bc5
commit e576e6d971

View File

@@ -86,9 +86,15 @@ var EditPage = React.createClass({
},
handleTextChange : function(text){
//If there are errors, run the validator on everychange to give quick feedback
var htmlErrors = this.state.htmlErrors;
if(htmlErrors.length) htmlErrors = Markdown.validate(text);
this.setState({
text : text,
isPending : true
isPending : true,
htmlErrors : htmlErrors
});
(this.hasChanges() ? this.debounceSave() : this.debounceSave.cancel());