cerebral-legacy / cerebral-module-forms

Form handling for Cerebral
http://cerebral-website.herokuapp.com/documentation/cerebral-module-forms
MIT License
12 stars 5 forks source link

isValid is inconsistent. #6

Closed kgdev closed 8 years ago

kgdev commented 8 years ago

I think we need a better way to handle isValid.

If a field is not required and has no value, we should not run the validations as all and isValid=true&errorMessage=null.

Otherwise, always run the validations when a field is added or its value is updated.

abalmos commented 8 years ago

Looks like this bug is limited to configureField(). The signals use https://github.com/cerebral/cerebral-module-forms/blob/master/actions/shouldValidate.js#L3 which should be stopping field validations on fields with no value.

edgesoft commented 8 years ago

@kgdev Can you verify this again. I have a field that is not required and has no value and I have isValid = true and errorMessage = null.

christianalfoni commented 8 years ago

Closing this, feel free to repoen @kgdev :)