bpmn-io / form-js

View and visually edit JSON-based forms.
https://bpmn.io/toolkit/form-js/
Other
405 stars 103 forks source link

validate() method is always true on first init #1167

Open bilalmalkoc opened 5 months ago

bilalmalkoc commented 5 months ago

If form has required fields, validate() method should returns with error messages on first init. But it returns empty object.

I am trying to get form is valid or not on first load but i can not find any method to understand this. Therefore i am using validate() method but it works only if i trigger any input field on the form.

Steps to Reproduce

  1. Create a form viewer with required text field.
  2. Get errors with validate() method to understand if form is valid or not (without trigger any input)
  3. now this happens

Expected Behavior

I think validate() method should return errors on first init without trigger any input field. Or if any method exists to understand, i will use it.

Environment