json-schema-form / angular-schema-form

Generate forms from a JSON schema, with AngularJS!
https://json-schema-form.github.io/angular-schema-form
MIT License
2.47k stars 653 forks source link

schemaFormValidate event doesn't trigger past v0.8.2 #828

Closed VladVM closed 7 years ago

VladVM commented 7 years ago

Problem/question

I am trying to use schemaFormValidate event to make all the form fields validate on external event. After a few hours of digging into my code I've copied a libraries from plunker sample I seen before, and to my surprise I worked. I figured that the behavior changed somewhere after 0.8.2, but I was not able to find any mention on that in the documentation.

Expected behaviour

I expected comment field to notify on validation failure when I click on xxxxx text and schemaFormValidate event is broatcast.

Actual behaviour

In latest version, no indication is happening. in version 0.8.2 it works as expected.

Gist/Plunker/Demo

Example I created for stack overflow question based on v 0.8.2

Anthropic commented 7 years ago

@VladVM thanks for that, and the plunker, I will try to make a test case for it so it can get fixed :)

Anthropic commented 7 years ago

I need to add a spec src/directives/schema-validate.directive.spec.js to test that the schemaFormValidate event is both heard and then processed.

Then I can track down and fix where the issue is occurring once it passes with older versions.

Anthropic commented 7 years ago

@VladVM could you try it with the current version in development branch? Specifically if you think the test I added in schema-validate.directive.spec.js covers everything?

VladVM commented 7 years ago

@Anthropic I've tried it. I've reproduced the issue and then took the current dev version. Now it works as expected with the latest fix.

Spec file covers the exact scenario that was failing. I am not aware of other failing cases.