angular-schema-form icon indicating copy to clipboard operation
angular-schema-form copied to clipboard

Missing Validation Message in untouched form when broadcasting schemaFormValidate

Open luizgrs opened this issue 10 years ago • 1 comments

Hi,

I may have found an issue with validators and validation messages.

To make the plunker simple I just checked if the value is empty, but in my real case the validation is more complex.

If I have a field with $validators and broadcasts schemaFormValidate without touching it, the field is set as invalid as expected but the validation message does not appear. To get the error message, I have to type anything in the field and then clear that.

Am I missing something?

Steps to reproduce:

  1. setup a form with sf-schema, sf-form (one text field and one submit button), sf-model
    • in the text field set $validators (in the example it just checks if the value is empty) and a validationMessage
  2. setup ng-submit in form to a function which broadcasts schemaFormValidate
  3. access the page and click in the submit button

Expected behaviour

I expected that the form would be validated and the error message would appear because the field is empty

Actual behaviour

The form was validated as expected, the field was set as invalid (error feedback appears), but the error message does not appear.

Gist/Plunker/Demo

https://plnkr.co/edit/IuTv9HdwHRJpT1so6J6u

Related issues

I didn't find any report of this issue or something related, sorry if it exists...

@json-schema-form/angular-schema-form-lead

luizgrs avatar Oct 22 '16 00:10 luizgrs

I just found https://github.com/json-schema-form/angular-schema-form/issues/602 it looks like the same issue, sorry. I posted my plunker there.

luizgrs avatar Oct 22 '16 00:10 luizgrs