Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from hacklanta/empty-validation
Empty Validation: Allow validating fields that are not sent to the server We have an issue where an empty field can't be marked as invalid because it never gets a chance to run against validations. To fix this, we: - Separate the computation of the final, fully validated value of the field into its own method, and cache it in a `TransientRequestVar`. - Cache the field name in a `RequestVar` and abstract out the adding of a validation error for the field based on this cache. - Introduce a new concept, boxed validations, which are validations that can take boxes of the field value instead of just the field value. - Add overloads for `withValidation` and `?` to be able to add boxed validations. - Run those validators when computing the final value if there is no seen value for the field, allowing the boxed validators to run even if there is no submission for the field.
- Loading branch information