fonk
fonk copied to clipboard
Firing validations only when some DOM event type occurs
We would like to consume navite DOM event types and it only fires desired validations on that events.
Somethink like:
const validationSchema: ValidationSchema = {
field: {
login: [
// fire validation only for change and blur events
{ validator: Validators.required.validator, events: ['change', 'blur'] }
],
password: [
// Fire validations for any event
{ validator: Validators.required.validator }
],
}
}
DOM typings: search GlobalEventHandlersEventMap inside file.