Closed TreavorPhilyaw closed 3 years ago
+1 for this PR; I would really like to disable my save/apply buttons when the JSON in the code editor is invalid 👍
+1 for the PR. @vankop can you please take a look at this one?
thanks!
The latest master doesn't have changes from this PR. That's why 3.1.0 version doesn't expose error on the outside.
@vankop Are we planning to release a new version any time soon? it has been a long time since this PR got merged. Appreciate help !!
@vejandla this PR partially released, problem here that code
if(this.props.onError) {
const error = typeof err === 'object' ? err.message : err;
this.props.onError(error);
}
will trigger onError
on every invalid JSON, but in mode=text it is ok to have invalid JSON
This resolves two issues
When you change the value in the JSON editor only this.err is updated but is unreliable due to it not being cleared. So a call to onError would help https://github.com/vankop/jsoneditor-react/issues/17
Reset this.err when there is no longer an error with the json to make it more reliable https://github.com/vankop/jsoneditor-react/issues/30