Skip to content

Missing Validation Message in untouched form when broadcasting schemaFormValidate #795

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

Closed
luizgrs opened this issue Oct 22, 2016 · 1 comment

Comments

@luizgrs
Copy link

luizgrs commented Oct 22, 2016

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
Copy link
Author

luizgrs commented Oct 22, 2016

I just found #602 it looks like the same issue, sorry. I posted my plunker there.

@luizgrs luizgrs closed this as completed Oct 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant