Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal. Ace input validation callback #245

Closed
tsmirnov opened this issue Aug 11, 2017 · 4 comments
Closed

Proposal. Ace input validation callback #245

tsmirnov opened this issue Aug 11, 2017 · 4 comments
Assignees

Comments

@tsmirnov
Copy link
Contributor

tsmirnov commented Aug 11, 2017

Hi, everyone.

We need small validation in ReactAce. We don't want to allow users submit code event with any kind of warnings. ReactAce show that warnings (like missing semicolon). As I know, there is no standard way to get the results of validation. (Issue #144) Am I right?

If so, I suggest to add a new callback prop onValidate. We can add listener on change annotations and invoke that callback. For example:

editor.getSession().on('changeAnnotation', function() {
  const annotations = editor.getSession().getAnnotations();
  onValidate(annotations);
});

If that functionality make sense, I could work on PR. What do you think?

@securingsincity
Copy link
Owner

@tsmirnov I think that sounds good. I would like to see a PR.

@securingsincity
Copy link
Owner

This will be live in 5.2.0 which is going live now.

@volkandkaya
Copy link

volkandkaya commented Dec 18, 2018

Any documentation for this? I don't want to allow the user to submit if there are errors. @securingsincity

@volkandkaya
Copy link

Was able to find it, I added a ref then this.editorRef.current.editor.session.$annotations was the path towards it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants